amazon-cloudformation

Static IP for Auto Scale in AWS

前提是你 提交于 2019-12-10 02:26:43
问题 I need all of my instances in AWS auto scaling group to be configured with (known) static IP's. I will be whitelisting all of these IPs in a mail server later (that's why need all of them to be static). Is it possible using the regular cloudformation approach? May be assigning a second NIC and assigning it an IP from a static IP range? Any ideas? 回答1: Unfortunately, you can't gain access to any custom IP range for your autoscaling group. You could get the IP range for the region you are

How do we access and respond to CloudFormation custom resources using an AWS Lambda function written in Java?

扶醉桌前 提交于 2019-12-09 18:08:35
问题 I have am AWS Lambda function written in Java that I would like to use as part of a response to an AWS CloudFormation function. Amazon provides two detailed examples on how to create a CloudFormation custom resource that returns its value based on an AWS Lambda function written in Node.js, however I have been having difficulty translating the Lambda examples into Java. How can we setup our AWS Java function so that it reads the value of the pre-signed S3 URL passed in as a parameter to the

AWS Cloudformation parameter dependency

情到浓时终转凉″ 提交于 2019-12-09 16:24:28
问题 I'm trying to do the following: "Parameters": { "InterfaceMode" : { "Description": "Configure instance to run in onearm or inline mode", "Type": "String", "Default": "onearm", "AllowedValues": [ "onearm", "inline" ], } "InlineSubnetId" : { "Description": "Name of a subnet assigned to the VPC to use for second interface in inline mode.", "Type": "AWS::EC2::Subnet::Id", "Default": "None" }, Now if the user selects onearm, only one interface is needed and the InlineSubnetId is not needed.

CodePipeline: How to reference nested CloudFormation Stacks from GitHub as Source

旧街凉风 提交于 2019-12-09 13:11:00
问题 Our CloudFormation templates are stored in GitHub. Inside CodePipeline we're using GitHub as our Source, but we can't reference nested CloudFormation Stacks when they're not stored on S3. How can we reference CloudFormation nested Stacks when using GitHub as our source in CodePipeline? If this is not possible, how can we upload the CloudFormation Templates from GitHub to S3 between the Source Stage (from GitHub) and the Deploy Stage in CodePipeline? 回答1: There are two approaches I can think

How to set the origin path on an Custom origin using CloudFormation?

感情迁移 提交于 2019-12-09 03:17:27
I have tried this { "DomainName": "myapi.execute-api.us-east-1.amazonaws.com/dev, "Id": "APIEndPoint", "CustomOriginConfig": { "OriginProtocolPolicy": "https-only", "OriginSSLProtocols":["TLSv1", "TLSv1.1", "TLSv1.2"] } Ref: https://aws.amazon.com/about-aws/whats-new/2014/12/16/amazon-cloudfront-now-allows-directory-path-as-origin-name/ . But I am getting the below error The parameter origin name must be a domain name. (Service: AmazonCloudFront; Status Code: 400; Error Code: InvalidArgument; Request ID: I have found the answer we just need to add OriginPath attribute. Here it is { "DomainName

Is there a way to unit test AWS Cloudformation template

纵然是瞬间 提交于 2019-12-08 23:01:26
问题 When we say that cloudformation is 'Infrastructure as Code', the next question that immediately comes to mind is how can this code be tested. Can we do some sort of basic unit test of this code And I am discounting the cloudformation validation because that just is a way of doing syntactic validation, and that I can do with any other free JSON/YAML validator. I am more inclined towards some sort of functional validation, possibly testing that I have defined all the variables that are used as

How do I pass UserData to a Beanstalk instance with CloudFormation

泄露秘密 提交于 2019-12-08 22:00:56
问题 I need the application server, which is beanstalk instances, to do some actions upon startup and I thought of running a bash script passed to the instance with the UserData property which is available to regular EC2 instances. I've found several example CloudFormation templates which does this with regular EC2 instances, but no example with Beanstalk. I've tried to add this to the properties field for the application: "MyApp" : { "Type" : "AWS::ElasticBeanstalk::Application", "Properties" : {

ECS and Application Load Balancer

爱⌒轻易说出口 提交于 2019-12-08 17:20:39
问题 Ive been looking for some information on Cloud Formation with regards to creating a stack with ECS and ELB (Application Load Balancer) but unable to do so. I have created two Docker images each containing a Node.js microservice that listens on ports 3000 and 4000 . How do I go about creating my stack with ECS and ELB as mentioned ? I assume the Application Load Balancer can be configured to listen to both these ports ? A sample Cloud Formation template would really help. 回答1: The Application

AWS Api Gateway proxy resource using Cloudformation?

半世苍凉 提交于 2019-12-08 16:37:40
问题 I'm trying to proxy an S3 bucket configured as a website from an API Gateway endpoint. I configured an endpoint successfully using the console, but I am unable to recreate the configuration using Cloudformation. After lots of trial and error and guessing, I've come up with the following CF stack template that gets me pretty close: Resources: Api: Type: 'AWS::ApiGateway::RestApi' Properties: Name: ApiDocs Resource: Type: 'AWS::ApiGateway::Resource' Properties: ParentId: !GetAtt Api

Delete export variable and help removing circular dependency

匆匆过客 提交于 2019-12-08 12:50:32
问题 We have a Cloudformation stack, we export a ARN which is created by the stack and import it inside the same stack. When we try to delete the stack, It tries to delete the output first and realizes the output is in use and does not delete the stack. We are looking for guidance on how to redeploy the stack or edit the stack so we can remove the dependency. We tried editing the stack in config editor, but the changes not being saved and still get the same error when trying to delete the stack.