provider-aws icon indicating copy to clipboard operation
provider-aws copied to clipboard

Support for CloudFormation Stack alpha quality (create/delete only)

Open gmichelo opened this issue 2 years ago • 0 comments

Description of your changes

  1. Generated APIs and controller for cloudformation.Stack resource.
  2. CloudFormation Describe API returns "ValidationError" code when the Stack does not exist, hence the expection in generator-config.yaml.
  3. Update is not supported yet.

Fixes: #1457

I have:

  • [x] Read and followed Crossplane's contribution process.
  • [x] Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Try to manually create a stack resource:


cat > cf-stack.yaml  <<EOF
apiVersion: cloudformation.aws.crossplane.io/v1alpha1
kind: Stack
metadata:
  name: cloudformation-stack-test
spec:
  forProvider:
    stackName: cloudformation-stack-test
    region: us-east-1
    templateBody: |
        {
            "Resources": {
                "VPC": {
                    "Type": "AWS::EC2::VPC",
                    "Properties": {
                        "CidrBlock": "10.2.0.0/16",
                        "EnableDnsSupport": true,
                        "EnableDnsHostnames": true,
                        "Tags": [
                            {
                                "Key": "Name",
                                "Value": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            {
                                                "Ref": "AWS::StackName"
                                            },
                                            "-VPC"
                                        ]
                                    ]
                                }
                            }
                        ]
                    }
                }
            }
        }
EOF

kubectl apply -f cf-stack.yaml

Then check that (1) the Stack is created on your AWS account and (2) the stack resource has synced:

kubectl get stacks

NAME                        READY   SYNCED   EXTERNAL-NAME
cloudformation-stack-test   True    True     cloudformation-stack-test

gmichelo avatar Aug 31 '22 23:08 gmichelo