amazon-cloudformation

How to use !FindInMap in !Sub | userdata section

无人久伴 提交于 2019-12-21 17:31:49
问题 Currently I am converting CFT from JSON to Yaml. Everything works fine until Userdata section.I am having hard time to use any of functions like !Ref or !FindInMap in userdata section. UserData: Fn::Base64: !Sub | #!/bin/bash -v /command {Fn::FindInMap: [ "url", Ref: AWS::Region, Ref: EnvironmentType ] } It would be very helpful, If anyone can share any snippet of code. 回答1: I've been having fun and games with this as well. Although the documentation says that Fn::FindInMap is supported in Fn

Using Ref as the first argument in Fn::Sub intrinsic function

ⅰ亾dé卋堺 提交于 2019-12-21 09:33:17
问题 I experience quite strange issues when compiling the template, where I reference a string parameter in Fn::Sub , while the docs do explicitly say that one can use Ref function inside of Fn::Sub . Here is a piece of template: "Resources": { "LaunchConfiguration": { "Type" : "AWS::AutoScaling::LaunchConfiguration", "Properties" : { "UserData": { "Fn::Base64": { "Fn::Sub": { "Ref": "UserDataParam" } } }, And here is an error I get: Template error: One or more Fn::Sub intrinsic functions don't

How to refer a derived variable in Cloudformation

有些话、适合烂在心里 提交于 2019-12-21 07:58:06
问题 I am looking for small help in cloudformation and could not find help from documentation or may be not searching the question in right way. Here is the question. I am getting availability zones for the environment from mappings as follows. "AvailabilityZone": { "Fn::Select": [ "1", { "Fn::FindInMap": [ "Environment", { "Ref": "EnvType" }, "AvailabilityZones" ] } ] } I need to use the AZ name in my volume naming convention. How could refer the derived variable "AvailabilityZone" again.?

RDS with Cloud Formation and AZ issues

霸气de小男生 提交于 2019-12-21 06:58:31
问题 I am using cloud formation to create a setup containing an RDS instance. I am having some difficulties creating the RDS Instance on the account of the following error: DB Subnet Group doesn't meet availability zone coverage requirement. Please add subnets to cover at least 2 availability zones. Current coverage: 1 The problem is that the entire setup is on a single AZ... what am i supposed to do? just create an extra subnet in a different AZ that has nothing in it just for the RDS? Maybe

CloudFormation to setup CodePipeline/CodeBuild to deploy SAM application

馋奶兔 提交于 2019-12-21 06:57:40
问题 I have successfully setup CodePipeline and CodeBuild to deploy my SAM applications. But now I want to convert this to CloudFormation. How do I do this? I followed the steps here http://docs.aws.amazon.com/lambda/latest/dg/automating-deployment.html I am stuck at the CodeBuild part of the CloudFormation template ... 回答1: If you're looking for an example of how to set up CodePipeline and CodeBuild using Cloudformation, I'd recommend checking out this example template from one of my colleagues,

Unable to define Math Expression for Cloudwatch Alarm in a Cloudformation Template

怎甘沉沦 提交于 2019-12-21 05:09:31
问题 Recently AWS announced that Cloudwatch alarms can use Math Expressions on metrics. I decided to create an alarm that compares the SUM of 2 single metrics with a given threshold. This means that according to AWS documentation my expression should be SUM([m1,m2]), where m1 and m2 are 2 single metrics. I also decided to implement this idea using a cloudformation template (in yaml). Here's the Cloudwatch alarm definition: BillingAlarmExpression: Type: AWS::CloudWatch::Alarm Properties:

Cannot set a property of cognito userpool client via cloudformation

99封情书 提交于 2019-12-21 02:36:13
问题 I am trying to run congnito via cloudformation and everything works but there is section in cognito as follows: As you see there is section "Enable identity providers" and I can not find where I can set it to my cognito user pool in cloudformation! I tried this attributes but it says not supported. SupportedIdentityProviders Here is my code for user pool client: UserPoolClient: Type: "AWS::Cognito::UserPoolClient" Properties: ClientName: !Sub ${project}-client ExplicitAuthFlows: - ADMIN_NO

Conditionally create CodePipeline actions based on CloudFormation conditions

[亡魂溺海] 提交于 2019-12-20 21:01:42
问题 Enable / disable sections of a CloudFormation for CodePipeline using Conditionals: This creates a manual notification action once staging has been built and passed Runscope tests: - InputArtifacts: [] Name: !Join ["",[!Ref GitHubRepository, "-prd-approval"]] ActionTypeId: Category: Approval Owner: AWS Version: '1' Provider: Manual OutputArtifacts: [] Configuration: NotificationArn: !GetAtt ["SNSApprovalNotification", "Outputs.SNSTopicArn"] ExternalEntityLink: OutputTestUrl RunOrder: 3 How to

AWS cloud formation Template- providing Tags for the stack in the template

纵饮孤独 提交于 2019-12-20 12:09:02
问题 We wanted to use company specific Tags to the resources that we create in AWS for billing purposes. I am using a cloud formation template to spin up our Elasticbeanstalk instance and other project dependent resources. When I use the CloudFormation console to create a stack it asks me for Tags in the page after parameters. I have to manually input the Tags for that stack. However is there a way to specify those Tags (Tags for the stack) with in the cloud formation template itself? That way the

CloudFormation insists my DynamoDB creation JSON is invalid .. but I can't see how

可紊 提交于 2019-12-20 09:26:05
问题 Here's (the DynamoDB part of) my Troposphere-generated JSON: "sandbox": { "Properties": { "AttributeDefinitions": [ { "AttributeName": "audit_id", "AttributeType": "S" }, { "AttributeName": "status", "AttributeType": "S" }, { "AttributeName": "filename", "AttributeType": "S" }, { "AttributeName": "file_detected_dt", "AttributeType": "S" }, { "AttributeName": "time_taken", "AttributeType": "N" }, { "AttributeName": "number_rows_processed_file", "AttributeType": "N" }, { "AttributeName":