amazon-cloudformation

Template format error: unsupported structure seen in AWS CloudFormation

别等时光非礼了梦想. 提交于 2019-12-05 02:27: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? bgenchel Apparently, the very unhelpful error message comes as a result of improper formatting in the CLI command. The --template

Export existing AWS Lambda and API Gateway to Cloudformation template

*爱你&永不变心* 提交于 2019-12-05 02:22:24
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? Partial solution: there is ability to export Lambda function to AWS SAM file and then We will get YAML file which describes your Lambda function as 'AWS::Serverless::Function'. But

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

僤鯓⒐⒋嵵緔 提交于 2019-12-04 22:02:48
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. 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] It could also be formatted as: UserData: Fn::Base64: !Sub - | #!/bin/bash -xe foo=${foo} baz=${baz} - { foo:

Elasticache replication group id in CloudFormation template

◇◆丶佛笑我妖孽 提交于 2019-12-04 21:17:17
问题 How do you set the Redis ReplicationGroup ID when using a CloudFormation template? All the options in the docs show no way to do that and the CLI you can do this easily. My end goal is to have a Redis replication group with 3 cluster members but I want to choose the name rather than AWS set a unique name for me. Here's a snippet of my template: "Resources": { "mqpReplicationGroup": { "Type": "AWS::ElastiCache::ReplicationGroup", "Properties": { "CacheNodeType": { "Ref": "CacheNodeType" },

userData are not getting executed after launching the instance by cloudformation

梦想与她 提交于 2019-12-04 19:38:30
I created a AWS cloudformation, which creates a launch configuration and an autoscaling group. In the user Data in the launch Config I have configured the file system mount target, and I installed the cloudwatch agent: Code EDITED "LaunchConfig":{ "Type":"AWS::AutoScaling::LaunchConfiguration", "Metadata" : { "AWS::CloudFormation::Init" : { "config" : { "files" : { "/etc/cwlogs.cfg": { "content": { "Fn::Join" : ["", [ "[general]", "state_file = /var/awslogs/state/agent-state", "[/var/log/syslog]", "file = /tmp/", "log_group_name = ecs-dataloader", "log_stream_name = ECS-loader", "datetime

CloudFormation API Gateway CORS issue access to XMLHttpRequest blocked

自作多情 提交于 2019-12-04 19:25:32
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 differences in their Method Request , Integration Request , Integration Response and Method Response for

Reuse list of CloudFormation tags

不羁的心 提交于 2019-12-04 18:28:34
问题 I have a rather complex set of CloudFormation templates that I use for provisioning the different environments of our infrastructure. However I recently got the request to tag the created resources with a rather extensive list of tags (like 15). Hardcoding the tags into each of the template file doesn't seem like a good idea to me. I would rather create the list of tags once and refer to them for every taggeable resource. Problem is: I am not even sure this is possible. Do you know of any way

How to provision a CloudFront distribution with an ACM Certificate using Cloud Formation

て烟熏妆下的殇ゞ 提交于 2019-12-04 16:35:45
问题 I am attempting to set a certificate in my CloudFrontDistribution using Cloud Formation. My certificate has been issued via Certificate Manager. It has been approved, and I have validated that the certificate works by manual configuration directly through the CloudFront console. Within my CloudFormation template, I have attempted to use both the Identifier and ARN values associated with the certificate in the IamCertificateId property: "ViewerCertificate" : { "IamCertificateId" : "********",

AWS Cloudformation: Loadbalancer Custom SSL Negotiation Policy

半腔热情 提交于 2019-12-04 14:10:01
Trying to set up a cloudformation template with a custom SSL Negotiation policy. The cloudformation error I am getting is: CREATE_FAILED AWS::ElasticLoadBalancing::LoadBalancer BackendELB SSLNegotiationPolicy cannot be enabled My cloudformation template section is as follows: "Policies" : [ { "PolicyName": "SSLNegotiationPolicy", "PolicyType": "SSLNegotiationPolicyType", "Attributes": [ { "Name" : "Protocol-TLSv1", "Value" : "true" }, { "Name" : "Protocol-TLSv1.1", "Value" : "true" }, { "Name" : "Protocol-TLSv1.2", "Value" : "true" }, { "Name" : "Protocol-SSLv2", "Value" : "false" }, { "Name"

How do you package up a visual studio aws serverless project?

青春壹個敷衍的年華 提交于 2019-12-04 12:45:00
I'm trying to figure out if there is a way I can package up an aws serverless project in an automated way so that we can split our build and release pipeline up. Using the dotnet lambda command line tools, I can see there is a dotnet lambda package command to package the lambda as a .zip file ready for deployment. But I can't find anything for packaging the whole serverless application up. Is this possible? If so what commands do I run? We're running on VSTS for the Build and Release pipelines, however I don't really think I makes any difference as long as I can script it out. Looks like this