Relative Content

Tag Archive for amazon-web-servicesaws-cloudformation

AWS Cloudfromation Fn::ForEach does not accept values from Mappings

Below is my Resources Section in CFN template. I want to create AWS Route53 Record Sets but the problem is that I need to hard code the number for iterations for the forEach as can be seen below under RecordSetLogicalId. I want those to come from the Mappings section of the CFN template so that I can create unequal number of record sets in different AWS Accounts. For example 3 in Dev and 5 in Prod. When I try to use FindInMap or Split functions, I get a cfn linting error ‘[cfn-lint] E0001: Error transforming template: Fn::ForEach values must be a list of 3 elements’

How to use local cloudformation template file instead of uploading in s3?

I want to use multiple templates which will have multiple templates file directory and structure in cloudformation I don’t want to use s3 bucket cause there will be multiple files later and I will use ci-cd pipeline to deploy my changes this is my file i am trying to deploy in cloudformation

Cloudformation nested stack Update Failure

I have Cloudformation with multiple nested stack templates. In the below sample, I want to create the Route53 resources after the load balancers have been created so I put DependsOn LOADBALANCER stack to ensure the nested templates are created in order. This works. However, if I already have everything created and do an update by changing the “CreatePrivateLoadbalancer” parameter to false, the stack update fails because it tries to delete the PrivateLoadbalancer first, but it cannot because ROUTE53 stack is using the output of PrivateLoadbalancer. Ideally, it should delete the ROUTE53 resource first then delete the LOADBALANCER resource. Any suggestions?