Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Parameter type ignored when passed to NestedStacks #10794

Closed
1 task done
lukasz-mazur2 opened this issue May 8, 2024 · 2 comments · Fixed by #10836
Closed
1 task done

bug: Parameter type ignored when passed to NestedStacks #10794

lukasz-mazur2 opened this issue May 8, 2024 · 2 comments · Fixed by #10836
Assignees
Labels
aws:cloudformation AWS CloudFormation status: backlog Triaged but not yet being worked on type: bug Bug report

Comments

@lukasz-mazur2
Copy link

lukasz-mazur2 commented May 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have a cloudformation nested stack failing to deploy.

{
    "StackId": "arn:aws:cloudformation:eu-west-1:000000000000:stack/cloudformation-alb/0153cfef"
}
Waiting for stack creation...

Waiter StackCreateComplete failed: Waiter encountered a terminal failure state: For expression "Stacks[].StackStatus" we matched expected path: "CREATE_FAILED" at least once

The main template looks like this:

AWSTemplateFormatVersion: '2010-09-09'
Parameters:
  VPC:
    Type: AWS::EC2::VPC::Id
    Default: vpc-17c17d56
  SubnetDMZA:
    Type: AWS::EC2::Subnet::Id
    Default: subnet-879e3ee0
  SubnetDMZB:
    Type: AWS::EC2::Subnet::Id
    Default: subnet-c819287c
Resources:
  LoadBalancer:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: https://nested-templates.s3.localhost.localstack.cloud/templates/cloudformation-alb/1/0/cloudformation-alb-v1.0.0.yaml
      Parameters:
        ResourceNamePrefix: system-team-it
        VPC:
          Ref: VPC
        Subnets:
          Fn::Sub: ${SubnetDMZA}, ${SubnetDMZB}
        DomainName: localstack.test.cloud
Outputs:
  ALBARN:
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - Outputs.ARN
  ALBDNSName:
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - Outputs.DNSName
  ALBSecurityGroupID:
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - Outputs.SecurityGroupID
  ALBListener:
    Value:
      Fn::GetAtt:
        - LoadBalancer
        - Outputs.Listener

Inside the nested stack template we use a PyPlate macro

The 'Subnets' parameter expected by the template:

  Subnets:
    Type: CommaDelimitedList
    Description: The IDs of the public DMZ subnets

The PyPlate code that is failing:

      Subnets: |
        #!PyPlate
        import boto3
        client = boto3.client('ec2')
        subnets = params['Subnets']
        vpc_id = params['VPC']
        for subnet in subnets:
            response = client.describe_subnets(SubnetIds=[subnet])
            sub_vpc_id = response['Subnets'][0]['VpcId']
            if sub_vpc_id != vpc_id:
                raise Exception("Provided subnets have to be part of the provided VPC!")
            tags = response['Subnets'][0]['Tags']
            for tag in tags:
                if tag['Key'] == 'Name':
                    subnet_name = tag['Value']
            if 'public-dmz' not in subnet_name:
                raise Exception("Application Load Balancer can be deployed only in public-dmz subnets!")
        output = params['Subnets']

In the logs I can see that Subnets param values are passed as a single string instead of a list, which makes the python loop through the characters:

2914-47da-a810-af814ac562e8] botocore.exceptions.ClientError: An error occurred (InvalidSubnetID.NotFound) when calling the DescribeSubnets operation: The subnet ID 's' does not exist

Full debug log:

2024-05-08T08:50:03.206  INFO --- [   asgi_gw_0] localstack.request.aws     : AWS cloudformation.CreateStack => 200
2024-05-08T08:50:03.395 DEBUG --- [uncthread205] l.s.c.e.template_deployer  : Handling "Add" for resource "LoadBalancer" (1/1) type "AWS::CloudFormation::Stack" in loop iteration 1 (should_deploy=True)
2024-05-08T08:50:03.530  INFO --- [   asgi_gw_1] localstack.request.aws     : AWS cloudformation.DescribeStacks => 200
2024-05-08T08:50:03.635  INFO --- [   asgi_gw_1] localstack.request.aws     : AWS s3.GetObject => 200
2024-05-08T08:50:03.682 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : Got an invocation for function arn:aws:lambda:eu-west-1:000000000000:function:pyplate-cfn-transform-macro-eu-west-1:$LATEST with request_id f31ee29d-2914-47da-a810-af814ac562e8
2024-05-08T08:50:03.682 DEBUG --- [   asgi_gw_1] l.s.l.i.assignment         : Starting new environment
2024-05-08T08:50:03.682 DEBUG --- [   asgi_gw_1] l.s.l.i.docker_runtime_exe : Assigning container name of localstack-main-lambda-pyplate-cfn-transform-macro-eu-west-1-a224bf665846ed9d43a2fbe0368c27b3 to executor a224bf665846ed9d43a2fbe0368c27b3
2024-05-08T08:50:03.689 DEBUG --- [   asgi_gw_1] l.u.c.container_client     : Getting networks for container: localstack-main
2024-05-08T08:50:03.691  INFO --- [   asgi_gw_1] l.u.container_networking   : Determined main container network: bridge
2024-05-08T08:50:03.691 DEBUG --- [   asgi_gw_1] l.u.c.container_client     : Getting ipv4 address for container localstack-main in network bridge.
2024-05-08T08:50:03.695  INFO --- [   asgi_gw_1] l.u.container_networking   : Determined main container target IP: 172.18.0.2
2024-05-08T08:50:03.703 DEBUG --- [   asgi_gw_1] l.u.c.docker_sdk_client    : Creating container with attributes: {'self': <localstack.utils.container_utils.docker_sdk_client.SdkDockerClient object at 0x7fcd09a49bd0>, 'image_name': 'public.ecr.aws/lambda/python:3.9', 'name': 'localstack-main-lambda-pyplate-cfn-transform-macro-eu-west-1-a224bf665846ed9d43a2fbe0368c27b3', 'entrypoint': '/var/rapid/init', 'remove': False, 'interactive': False, 'tty': False, 'detach': False, 'command': None, 'mount_volumes': [], 'ports': <PortMappings: {}>, 'exposed_ports': [], 'env_vars': {'AWS_DEFAULT_REGION': 'eu-west-1', 'AWS_REGION': 'eu-west-1', 'AWS_LAMBDA_FUNCTION_NAME': 'pyplate-cfn-transform-macro-eu-west-1', 'AWS_LAMBDA_FUNCTION_MEMORY_SIZE': 128, 'AWS_LAMBDA_FUNCTION_VERSION': '$LATEST', 'AWS_LAMBDA_INITIALIZATION_TYPE': 'on-demand', 'AWS_LAMBDA_LOG_GROUP_NAME': '/aws/lambda/pyplate-cfn-transform-macro-eu-west-1', 'AWS_LAMBDA_LOG_STREAM_NAME': '2024/05/08/[$LATEST]a224bf665846ed9d43a2fbe0368c27b3', 'AWS_ACCESS_KEY_ID': 'LSIAQAAAAAAAOO274J72', 'AWS_SECRET_ACCESS_KEY': 'zmDvhYb2y1+uV9Lk9awZGA1RT1oOLYqdzh1BSZMz', 'AWS_SESSION_TOKEN': 'FQoGZXIvYXdzEBYaDlnHIJgIniLwkdMo+GwppnXOmNAMniyjsfBGr9j9p9e9SO+z8mDcxONMktrbi0gRtgbgcluMZfde8+KRZYzh+9r/btG06ItUwR/Y/SD09o9lh4I6W2EU3/4yUv2NrMzxENoIB/dYQieul4WQxhG14lHMfdD37aMrzdir+mMBF6PxAyRhmFImMYd0aKogPwtjncTrutuUhNband8vihbo3JNcRQxAsw9e0aWmd0gaGpT2IRzeecqdtRkoH/JALbJw9XGriUsthbTrvwqTndfD3O3vmc3+9OYAglBXjv5WQ986kjVJD0CdWJAA1uR5KsWjycDFu4BlTR2VrloC644=', 'LAMBDA_TASK_ROOT': '/var/task', 'LAMBDA_RUNTIME_DIR': '/var/runtime', 'AWS_XRAY_CONTEXT_MISSING': 'LOG_ERROR', 'AWS_XRAY_DAEMON_ADDRESS': '127.0.0.1:2000', '_AWS_XRAY_DAEMON_PORT': '2000', '_AWS_XRAY_DAEMON_ADDRESS': '127.0.0.1', 'TZ': ':UTC', 'AWS_LAMBDA_FUNCTION_TIMEOUT': 30, 'LOCALSTACK_HOSTNAME': '172.18.0.2', 'EDGE_PORT': '4566', 'LOCALSTACK_RUNTIME_ID': 'a224bf665846ed9d43a2fbe0368c27b3', 'LOCALSTACK_RUNTIME_ENDPOINT': 'http://172.18.0.2:4566/_localstack_lambda/a224bf665846ed9d43a2fbe0368c27b3', 'LOCALSTACK_FUNCTION_ACCOUNT_ID': '000000000000', 'AWS_ENDPOINT_URL': 'http://172.18.0.2:4566', '_HANDLER': 'index.handler', 'AWS_EXECUTION_ENV': 'AWS_Lambda_rapid', 'LOCALSTACK_MAX_PAYLOAD_SIZE': 6291556, 'AWS_CA_BUNDLE': '', 'LOCALSTACK_CHMOD_PATHS': '[{"path": "/tmp", "mode": "0700"}]'}, 'user': None, 'cap_add': None, 'cap_drop': None, 'security_opt': None, 'network': 'bridge', 'dns': '172.18.0.2', 'additional_flags': '', 'workdir': None, 'privileged': False, 'labels': None, 'platform': 'linux/amd64', 'ulimits': None, 'init': None}
2024-05-08T08:50:03.722 DEBUG --- [   asgi_gw_1] l.u.c.docker_sdk_client    : Copying file /usr/lib/localstack/lambda-runtime/v0.1.28-pre/x86_64/. into localstack-main-lambda-pyplate-cfn-transform-macro-eu-west-1-a224bf665846ed9d43a2fbe0368c27b3:/
2024-05-08T08:50:03.784 DEBUG --- [   asgi_gw_1] l.u.c.docker_sdk_client    : Copying file /tmp/lambda/awslambda-eu-west-1-tasks/pyplate-cfn-transform-macro-eu-west-1-f01e42db-0e22-429b-bce1-1330c09c1da7/code/. into localstack-main-lambda-pyplate-cfn-transform-macro-eu-west-1-a224bf665846ed9d43a2fbe0368c27b3:/var/task
2024-05-08T08:50:03.800 DEBUG --- [   asgi_gw_1] l.u.c.docker_sdk_client    : Starting container localstack-main-lambda-pyplate-cfn-transform-macro-eu-west-1-a224bf665846ed9d43a2fbe0368c27b3
2024-05-08T08:50:04.058 DEBUG --- [   asgi_gw_1] l.u.c.container_client     : Getting ipv4 address for container localstack-main-lambda-pyplate-cfn-transform-macro-eu-west-1-a224bf665846ed9d43a2fbe0368c27b3 in network bridge.
2024-05-08T08:50:04.101  INFO --- [   asgi_gw_2] localstack.request.http    : POST /_localstack_lambda/a224bf665846ed9d43a2fbe0368c27b3/status/a224bf665846ed9d43a2fbe0368c27b3/ready => 202
2024-05-08T08:50:04.101 DEBUG --- [   asgi_gw_1] l.s.l.i.execution_environm : Start of execution environment a224bf665846ed9d43a2fbe0368c27b3 for function arn:aws:lambda:eu-west-1:000000000000:function:pyplate-cfn-transform-macro-eu-west-1:$LATEST took 419.08ms
2024-05-08T08:50:04.102 DEBUG --- [   asgi_gw_1] l.s.l.i.docker_runtime_exe : Sending invoke-payload '{"invoke-id": "f31ee29d-2914-47da-a810-af814ac562e8", "invoked-function-arn": "arn:aws:lambda:eu-west-1:000000000000:function:pyplate-cfn-transform-macro-eu-west-1", "payload": "{\"region\": \"eu-west-1\", \"accountId\": \"000000000000\", \"fragment\": {\"AWSTemplateFormatVersion\": \"2010-09-09\", \"Description\": \"Template for Application LoadBalancer (no CloudFront) (v1.0.0-1bded9a-20240226T14Z)\", \"Transform\": [\"PyPlate\"], \"Parameters\": {\"ResourceNamePrefix\": {\"Type\": \"String\", \"Description\": \"Used to build name of the module resources (It can be the Cloudformation stack name for example)\", \"AllowedPattern\": \"^[a-z]+([a-z0-9])?+(-[a-z0-9]+)*$\", \"ConstraintDescription\": \"must start with a letter, must contain only lowercase alphanumeric characters and hyphens (-), but no two consecutive hyphens.\"}, \"VPC\": {\"Type\": \"AWS::EC2::VPC::Id\", \"Description\": \"The ID of the VPC to use\"}, \"Subnets\": {\"Type\": \"CommaDelimitedList\", \"Description\": \"The IDs of the public DMZ subnets\"}, \"Certificate\": {\"Type\": \"String\", \"Description\": \"ARN of the SSL/TLS wildcard certificate for the account\", \"Default\": \"\"}, \"DomainName\": {\"Type\": \"String\", \"Description\": \"Domain name for the wildcard certificate (e.g. sandbox.test.cloud)\"}}, \"Resources\": {\"LoadBalancer\": {\"Type\": \"AWS::ElasticLoadBalancingV2::LoadBalancer\", \"Properties\": {\"LoadBalancerAttributes\": [{\"Key\": \"idle_timeout.timeout_seconds\", \"Value\": 60}, {\"Key\": \"routing.http.drop_invalid_header_fields.enabled\", \"Value\": true}], \"Name\": {\"Fn::Sub\": \"${ResourceNamePrefix}-alb\"}, \"Scheme\": \"internet-facing\", \"SecurityGroups\": [{\"Ref\": \"SecurityGroup\"}], \"Subnets\": \"#!PyPlate\\nimport boto3\\nclient = boto3.client('ec2')\\nsubnets = params['Subnets']\\nvpc_id = params['VPC']\\nfor subnet in subnets:\\n    response = client.describe_subnets(SubnetIds=[subnet])\\n    sub_vpc_id = response['Subnets'][0]['VpcId']\\n    if su...' to executor 'a224bf665846ed9d43a2fbe0368c27b3'
2024-05-08T08:50:04.308  INFO --- [   asgi_gw_2] localstack.request.aws     : AWS ec2.DescribeSubnets => 400 (InvalidSubnetID.NotFound)
2024-05-08T08:50:04.322  INFO --- [   asgi_gw_2] localstack.request.http    : POST /_localstack_lambda/a224bf665846ed9d43a2fbe0368c27b3/invocations/f31ee29d-2914-47da-a810-af814ac562e8/logs => 202
2024-05-08T08:50:04.326  INFO --- [   asgi_gw_2] localstack.request.http    : POST /_localstack_lambda/a224bf665846ed9d43a2fbe0368c27b3/invocations/f31ee29d-2914-47da-a810-af814ac562e8/response => 202
2024-05-08T08:50:04.331 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : Got logs for invocation 'f31ee29d-2914-47da-a810-af814ac562e8'
2024-05-08T08:50:04.332 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8] START RequestId: f31ee29d-2914-47da-a810-af814ac562e8 Version: $LATEST
2024-05-08T08:50:04.332 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8] {"region": "eu-west-1", "accountId": "000000000000", "fragment": {"AWSTemplateFormatVersion": "2010-09-09", "Description": "Template for Application LoadBalancer (no CloudFront) (v1.0.0-1bded9a-20240226T14Z)", "Transform": ["PyPlate"], "Parameters": {"ResourceNamePrefix": {"Type": "String", "Description": "Used to build name of the module resources (It can be the Cloudformation stack name for example)", "AllowedPattern": "^[a-z]+([a-z0-9])?+(-[a-z0-9]+)*$", "ConstraintDescription": "must start with a letter, must contain only lowercase alphanumeric characters and hyphens (-), but no two consecutive hyphens."}, "VPC": {"Type": "AWS::EC2::VPC::Id", "Description": "The ID of the VPC to use"}, "Subnets": {"Type": "CommaDelimitedList", "Description": "The IDs of the public DMZ subnets"}, "Certificate": {"Type": "String", "Description": "ARN of the SSL/TLS wildcard certificate for the account", "Default": ""}, "DomainName": {"Type": "String", "Description": "Domain name for the wildcard certificate (e.g. sandbox.test.cloud)"}}, "Resources": {"LoadBalancer": {"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer", "Properties": {"LoadBalancerAttributes": [{"Key": "idle_timeout.timeout_seconds", "Value": 60}, {"Key": "routing.http.drop_invalid_header_fields.enabled", "Value": true}], "Name": {"Fn::Sub": "${ResourceNamePrefix}-alb"}, "Scheme": "internet-facing", "SecurityGroups": [{"Ref": "SecurityGroup"}], "Subnets": "#!PyPlate\nimport boto3\nclient = boto3.client('ec2')\nsubnets = params['Subnets']\nvpc_id = params['VPC']\nfor subnet in subnets:\n    response = client.describe_subnets(SubnetIds=[subnet])\n    sub_vpc_id = response['Subnets'][0]['VpcId']\n    if sub_vpc_id != vpc_id:\n        raise Exception(\"Provided subnets have to be part of the provided VPC!\")\n    tags = response['Subnets'][0]['Tags']\n    for tag in tags:\n        if tag['Key'] == 'Name':\n            subnet_name = tag['Value']\n    if 'public-dmz' not in subnet_name:\n        raise Exception(\"Appl...
2024-05-08T08:50:04.332 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8] Traceback (most recent call last):
2024-05-08T08:50:04.332 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]   File "/var/task/index.py", line 30, in handler
2024-05-08T08:50:04.332 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]     macro_response["fragment"] = obj_iterate(response, params)
2024-05-08T08:50:04.333 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]   File "/var/task/index.py", line 7, in obj_iterate
2024-05-08T08:50:04.333 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]     obj[k] = obj_iterate(obj[k], params)
2024-05-08T08:50:04.333 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]   File "/var/task/index.py", line 7, in obj_iterate
2024-05-08T08:50:04.334 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]     obj[k] = obj_iterate(obj[k], params)
2024-05-08T08:50:04.334 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]   File "/var/task/index.py", line 7, in obj_iterate
2024-05-08T08:50:04.334 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]     obj[k] = obj_iterate(obj[k], params)
2024-05-08T08:50:04.334 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]   [Previous line repeated 1 more time]
2024-05-08T08:50:04.335 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]   File "/var/task/index.py", line 13, in obj_iterate
2024-05-08T08:50:04.336 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]     exec(obj, params)
2024-05-08T08:50:04.336 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]   File "<string>", line 7, in <module>
2024-05-08T08:50:04.336 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]   File "/var/runtime/botocore/client.py", line 553, in _api_call
2024-05-08T08:50:04.336 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]     return self._make_api_call(operation_name, kwargs)
2024-05-08T08:50:04.337 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]   File "/var/runtime/botocore/client.py", line 1009, in _make_api_call
2024-05-08T08:50:04.337 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8]     raise error_class(parsed_response, operation_name)
2024-05-08T08:50:04.337 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8] botocore.exceptions.ClientError: An error occurred (InvalidSubnetID.NotFound) when calling the DescribeSubnets operation: The subnet ID 's' does not exist
2024-05-08T08:50:04.337 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8] END RequestId: f31ee29d-2914-47da-a810-af814ac562e8
2024-05-08T08:50:04.337 DEBUG --- [   asgi_gw_1] l.s.l.i.version_manager    : [pyplate-cfn-transform-macro-eu-west-1-f31ee29d-2914-47da-a810-af814ac562e8] REPORT RequestId: f31ee29d-2914-47da-a810-af814ac562e8   Duration: 215.32 ms     Billed Duration: 216 ms Memory Size: 128 MB     Max Memory Used: 128 MB
2024-05-08T08:50:04.337 DEBUG --- [   asgi_gw_1] l.s.lambda_.provider       : Lambda invocation duration: 656.31ms
2024-05-08T08:50:04.387 DEBUG --- [   asgi_gw_0] l.s.cloudwatch.provider    : starting cloudwatch scheduler
2024-05-08T08:50:04.388 DEBUG --- [uncthread205] l.s.c.e.template_deployer  : Error applying changes for CloudFormation stack "cloudformation-alb": Unexpected status: ROLLBACK_COMPLETE Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/localstack/services/cloudformation/engine/template_deployer.py", line 1170, in _run
    self.do_apply_changes_in_loop(changes, stack)
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/localstack/services/cloudformation/engine/template_deployer.py", line 1244, in do_apply_changes_in_loop
    self.apply_change(change, stack=stack)
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/localstack/services/cloudformation/engine/template_deployer.py", line 1359, in apply_change
    progress_event = executor.deploy_loop(resource, resource_provider_payload)  # noqa
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/localstack/services/cloudformation/resource_provider.py", line 414, in deploy_loop
    event = self.execute_action(resource_provider, payload)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/localstack/services/cloudformation/resource_provider.py", line 479, in execute_action
    return resource_provider.create(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/localstack/services/cloudformation/resource_providers/aws_cloudformation_stack.py", line 128, in create
    raise Exception(f"Unexpected status: {stack['StackStatus']}")
Exception: Unexpected status: ROLLBACK_COMPLETE

2024-05-08T08:50:04.388  WARN --- [uncthread205] l.s.c.engine.entities      : CFn resource failed to deploy: LoadBalancer (Unexpected status: ROLLBACK_COMPLETE)
2024-05-08T08:50:33.585  INFO --- [   asgi_gw_1] localstack.request.aws     : AWS cloudformation.DescribeStacks => 200

Expected Behavior

Parameter type to be preserved when it's being passed to lambda like it is in AWS.

How are you starting LocalStack?

With the localstack script

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

docker run \
--rm \
--name localstack-main \
-p 4566:4566 \
-p 4510-4559:4510-4559 \
-e LOCALSTACK_AUTH_TOKEN="$LOCALSTACK_AUTH_TOKEN" \
-e LS_LOG=DEBUG  \
-e POD_LOAD_CLI_TIMEOUT=3000 \
-v /var/run/docker.sock:/var/run/docker.sock \
localstack/localstack-pro:3.3.0

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

awslocal cloudformation create-stack --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --stack-name cloudformation-alb --template-body file://template.yaml && awslocal cloudformation wait stack-create-complete --stack-name cloudformation-alb

Environment

- OS: 5.15.146.1-microsoft-standard-WSL2
- LocalStack: 3.3.1.dev20240328130241:dd48789

Anything else?

No response

@lukasz-mazur2 lukasz-mazur2 added status: triage needed Requires evaluation by maintainers type: bug Bug report labels May 8, 2024
@lukasz-mazur2
Copy link
Author

Same can be observed in LocalStack: 3.4.1.dev20240425063645:c7494f2

@lukasz-mazur2
Copy link
Author

It also seems to be the same issue I've reported earlier under #9558

@Anze1508 Anze1508 added aws:cloudformation AWS CloudFormation status: backlog Triaged but not yet being worked on and removed status: triage needed Requires evaluation by maintainers labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:cloudformation AWS CloudFormation status: backlog Triaged but not yet being worked on type: bug Bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants