amazon-cloudformation

Can you create Usage Plan with Cloud Formation?

依然范特西╮ 提交于 2019-12-06 05:00:28
just like in the title. I can deploy stuff on AWS using only Cloud Formation. Now I try to secure my API Gateway with API Keys and looks like I need a Usage Plan for it. It doesn't seem to be covered by the documentation right here: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html Have any of you had a similar problem and if yes, how did you solved it? AWS has today released the ability to create AWS::ApiGateway::UsagePlan using cloud formation templates Unfortunately there isn't currently a method of Adding API Keys to a UsagePlan through

How to use IAM role to access resources using temporary credentials?

时光毁灭记忆、已成空白 提交于 2019-12-06 04:21:59
问题 I'm using AWS IAM roles that allows an instance to have access to certain resources using temporary API credentials (access key, secret key and security token). When I test the temporary credentials using this ruby script, it runs without any problems : require 'rubygems' require 'aws-sdk' AWS.config( :access_key_id => "MY ACCESS KEY GOES HERE", :secret_access_key => "MY SECRET KEY GOES HERE", :session_token => "MY TOKEN GOES HERE") s3 = AWS::S3.new() myfile = s3.buckets['My-Config'].objects[

CloudFormation — possible to have nested Mappings?

被刻印的时光 ゝ 提交于 2019-12-06 02:31:24
问题 Is it possible to have nested Mappings in CloudFormation, like the following example? "Mappings" : { "Regions" : { "us-east-1" : { "Environments" : { "dev" : { "ImageId" : "something", "Subnet" : "something" }, "qa" : { "ImageId" : "something", "Subnet" : "something" } } }, "us-west-2" : { "Environments" : { "dev" : { "ImageId" : "something", "Subnet" : "something" }, "qa" : { "ImageId" : "something", "Subnet" : "something" } } } } } When I attempt to do something like this, I get the

aws CAPABILITY_AUTO_EXPAND console web codepipeline with cloudformation

喜夏-厌秋 提交于 2019-12-06 02:10:26
问题 I am trying to complete a codepipeline with the cloudformation service and this error is generated. It must be said that the separate cloudformation service works well. The complete error is: JobFailed Requires capabilities: [CAPABILITY_AUTO_EXPAND] (Service: AmazonCloudFormation; Status Code: 400; Error Code: InsufficientCapabilitiesException; Request ID: 1a977102-f829-11e8-b5c6-f7cc8454c4d0) The solutions I have is to add the CAPABILITY_AUTO_EXPAND --capabilities parameter but that only

How to configure “Instance Protection” over CloudFormation in AWS?

筅森魡賤 提交于 2019-12-06 01:31:25
问题 I need to set an "Instance Protection" property for the instances in my Auto Scaling Group using a CloudFormation template. I normally do it in my AWS console like this: EC2 -> Auto Scaling Groups But I can't seem to find it on CloudFormation documentation 回答1: It can be done using CloudFormation, but it's not easy. CloudFormation currently (as of 3/30/2016) does not officially support the Auto Scaling Instance Protection feature. CloudFormation unfortunately tends to lag behind new features

Change IAM Role for a Lambda in a CloudFormation template in a CodeStar project?

99封情书 提交于 2019-12-05 21:19:43
How can I change the IAM Role for a Lambda function in an CloudFormation template of an AWS CodeStar project? I have created a AWS CodeStar project (web service, Lambda based, Node.js). By default, AWS CodeStar generates the following CloudFormation: AWSTemplateFormatVersion: 2010-09-09 Transform: - AWS::Serverless-2016-10-31 - AWS::CodeStar Parameters: ProjectId: Type: String Description: AWS CodeStar projectID used to associate new resources to team members Resources: HelloWorld: Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: nodejs4.3 Role: Fn::ImportValue:

AWS CloudFormation /var/log/cloud-init-output.log equivalent for Windows AMIs

霸气de小男生 提交于 2019-12-05 12:36:37
When creating a Linux AMI in AWS with CloudFormation, I can view the output of the Cloud Init scripts, for example if I have a UserData section that echoes to stdout: "UserData": { "Fn::Base64": { "Fn::Join": [ "", [ "#!/bin/bash -xe\n", "echo hello, stdout\n" ] ] } } Then /var/log/cloud-init-output.log will contain these lines: + echo hello, stdout hello, stdout What is the equivalent log file for Windows AMIs? Is it somewhere in http://169.254.169.254/ , or is it a log file somewhere? According to the documentation you have to wrap UserData with <script></script> . The log is written to

How do I disable detailed monitoring for instances in an auto scaling group in a CloudFormation template?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 12:04:46
I'm using CloudFormation to spin up some servers in an auto scaling group, and I want them all to use basic monitoring. I tried setting Monitoring to false in the AWS::AutoScaling::AutoScalingGroup properties as well as the AWS::AutoScaling::LaunchConfiguration , but the stack cannot start up; I see CREATE_FAILED with the error message: Encountered unsupported property Monitoring . Just another day in the lovingly roguish world of almost-but-not-quite-consistant CFN template syntax. The property you want is InstanceMonitoring , not Monitoring . It should apply to your LaunchConfiguration

Listing more than 100 stacks using boto3

为君一笑 提交于 2019-12-05 11:28:37
We need to list all the stacks that are in CREATE_COMPLETE state. In our AWS account we have >400 such stacks. We have the following code written for this: stack_session = session.client('cloudformation') list_stacks = stack_session.list_stacks(StackStatusFilter=['CREATE_COMPLETE']) However this lists only the first 100 stacks. We want to know how we can get all the stacks? We are using the python boto3 library. I got this working using pagination. The code I wrote is below: stack_session = session.client('cloudformation') paginator = stack_session.get_paginator('list_stacks') response

Passing Parameters in Nested Cloud Formation templates

萝らか妹 提交于 2019-12-05 07:10:22
问题 I am calling CFT2 from CFT1 and I am passing a list of parameters.I recently came to know that we cant pass comma delimited list of parameters, so I am looking how to achieve that solution . This is my CFT1 : { "AWSTemplateFormatVersion": "2010-09-09", "Description": "Top Stack", "Resources": { "ChildStack01": { "Type" : "AWS::CloudFormation::Stack", "Properties" : { "TemplateURL": "https://s3.amazonaws.com/tbdchef/frontend1.json", "Parameters": { "AvailabilityZone1a": { "Default": "us-east