amazon-cloudformation

Not able to update cloudformation stack when having AWS SNS:Topic Resource

被刻印的时光 ゝ 提交于 2019-12-07 02:57:27
I have create a cloudformation template that creates one SNS::Topic and bunch of other resources. Problem now is that when i try to update the stack, it fails with the following error "Update to resource type AWS::SNS::Topic is not supported" Stack Policy is: { "Statement" : [ { "Effect" : "Deny", "Action" : "Update:*", "Principal": "*", "Resource" : "*", "Condition" : { "StringEquals" : { "ResourceType" : ["AWS::SNS::Topic", "AWS::EC2::Subnet"] } } }, { "Effect" : "Allow", "Action" : "Update:*", "Principal": "*", "Resource" : "*" } ] } CF Template is { "AWSTemplateFormatVersion": "2010-09-09"

AWS CloudFormation not creating initial instance in Auto Scaling group

不羁岁月 提交于 2019-12-07 01:03:25
问题 (Expired Pastbin Link Removed) Then I try to create a stack is fails to create the Auto Scaling group as no EC2 instances are created. How do I trigger the creation of the initial instance? Received 0 SUCCESS signal(s) out of 1. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement 回答1: I believe I was able to replicate your symptoms with your template - the issue may be related to the AMI you're using. I selected the AMI for my region from the marketplace link as referenced by the

How to get security group list in cloudformation

假如想象 提交于 2019-12-07 00:49:31
I want to get the list of security groups associated with a particular VPC in cloudformation parameter section. "VpcId":{ "Description":"Choose the VPC ID" "Type":"AWS::EC2::VPC::Id" }, "SecurityGroupsID":{ "Description": "Choose availablity zone Availability Zone of the Subnet", "Type":"List<AWS::EC2::SecurityGroup::Id>" "AllowedValues":******* }, What should be the allowedvalues..? Yes it is possible to use special template parameters, I created a small cloud formation template with just SecurityGroup and KeyPair parameters. When you create a stack using this template using console, it will

Export existing AWS Lambda and API Gateway to Cloudformation template

ⅰ亾dé卋堺 提交于 2019-12-06 21:30:06
问题 How to export existing configured and tested infrastructure (including AWS Lambda functions, API Gateways, ElastiCache clusters, Cloudwatch rules) to Cloudformation template? I know about Cloudformer tool, but it supports limited number of AWS services (Amazon VPC, DynamoDB, etc) and don't supports some of services which we use. Which tools and approaches can I use in my case for generating Cloudformation template? 回答1: Partial solution: there is ability to export Lambda function to AWS SAM

Template format error: unsupported structure seen in AWS CloudFormation

走远了吗. 提交于 2019-12-06 21:26:00
问题 I am trying to validate an AWS example CloudFormation template using a command like: ▶ aws cloudformation validate-template --template-body template.yml This leads to the following error message: An error occurred (ValidationError) when calling the ValidateTemplate operation: Template format error: unsupported structure. I tried this on many templates, including example templates from the AWS documentation. So I know the templates are okay. What am I doing wrong? 回答1: Apparently, the very

Use Pseudo Variables in Cloudwatch Dashboard Template (Cloudformation)

天涯浪子 提交于 2019-12-06 20:53:28
I am trying to set up a Cloud Formation Template to create a Cloudwatch-Dashboard. In this context I want to use the Pseudo Variable to ascertain the Region. If I simply use the Pseudo Variable AWS::Region the code doesnt seem to work: AutoscalingDashboard: Type: AWS::CloudWatch::Dashboard Properties: DashboardName: AutoscalingDashboard DashboardBody: ' { "widgets":[ { "type":"metric", "x":0, "y":0, "width":12, "height":6, "properties":{ "metrics":[ [ "AWS/ECS", "MemoryUtilization", "ServiceName", "invoice_web", "ClusterName", "InvoicegenappCluster" ], [ "...", "invoice_data", ".", "." ], [ ".

AWS Cloudformation Link API Key to API Gateway

喜夏-厌秋 提交于 2019-12-06 20:28:30
I have the following Cloudformation template I am trying to deploy via SAM. This template correctly creates the DynamoDB table, an API Key, a Lambda function and the API Gateway, but I cannot figure out what I need to specify in the template to associate the API KEY with the API Gateway. I have found plenty of snippets showing partial examples, but I am struggling to piece it all together. Thank you in advance, Denny AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Parameters: TableName: Type: String Default: 'influencetabletest' Description: (Required) The name of

How to add two variables in Cloudformation Fn::Sub in UserData

眉间皱痕 提交于 2019-12-06 15:45:28
问题 I am able to add 1 variable but unable to add second, I am a sys admin, and not that much knowledgeable about YAML UserData: Fn::Base64: !Sub - |+ #!/bin/bash -xe NEW_HOSTNAME=${test} - test: Fn::FindInMap: [Regions, !Ref "AWS::Region", Name] I would like to add another FindInMap variable after test, but I am unable to. 回答1: You can do it like this: UserData: Fn::Base64: !Sub - | #!/bin/bash -xe foo=${foo} baz=${baz} - foo: !FindInMap [FooMap, Foo, Value] baz: !FindInMap [FooMap, Baz, Value]

Lambda with cloud formation : Pass Cloud formation variable to python code

故事扮演 提交于 2019-12-06 15:06:16
问题 Hi below is the clouformation ,code we have python snippet for lambda function s3 to s3 copy.Here could not able to pass the destination bucket from cloud formation parameters to python snippet as target_bucket = Ref: dstBucket I am hardcoding now target_bucket = destination1 but i want to pass as Ref value I have tried different ways did not succeed. --- AWSTemplateFormatVersion: '2010-09-09' Description: 'objects from Prod bucket to Dev data bucket ' Parameters: CustomerName: Description:

CloudFormation API Gateway CORS issue access to XMLHttpRequest blocked

狂风中的少年 提交于 2019-12-06 13:51:54
问题 I'm trying to use CloudFormation to create an API Gateway but I have CORS issue with it. Error on the front-end: POST https://<>.execute-api.us-east-1.amazonaws.com/prod/<> 500 new:1 Access to XMLHttpRequest at '<>' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. The API is created without any issue and I even double check every single page on the console against the working API and find no