amazon-cloudformation

Installing Windows applications/extensions with Amazon CloudFormation

北城以北 提交于 2019-12-12 01:59:03
问题 Amazon's Windows Roles and Features template demonstrates how to install features on a server. But can anyone tell me how would I install an application/feature that is not present in this list, such as WebDeploy? I appreciate I could create a custom AMI, but I'm looking to do this entirely at template-level. Thanks in advance. 回答1: For your example of WebDeploy, you could add this: "C:\\Webdeploy\\WebDeploy_amd64_en-US.msi" : { "source" : "http://download.microsoft.com/download/1/B/3

Cloudformation to Change Ec2 Instance State

天大地大妈咪最大 提交于 2019-12-12 01:47:43
问题 Currently I am designing Cloudformation template to create an EC2 instance and monitor the EC2 instance, enable detail monitoring using cloudwatch and change the instance state to stop once it reached the metrics, I am able to create a instance able to enable metrics but I am not able to change the instance state to stop. 回答1: If you want to change the EC2 instance state to stop when a specified AWS::CloudWatch::Alarm Resouce transitions into ALARM state, you can accomplish this using the

How to get the CloudFormation resource value in user data bash code

我是研究僧i 提交于 2019-12-11 17:23:46
问题 I tried to mount ec2 instance to efs in launch configuration which is written in the YAML CloudFormation. I don't know how to get File-system-id which is created in the CloudFormation template. Is it possible to get the values of the AWS resource in bash code? Or is this any way that we can mount the ec2 instance to efs using CloudFormation. LaunchConfig: Type: AWS::AutoScaling::LaunchConfiguration Properties: ImageId: ami-33f92051 InstanceType: t2.micro AssociatePublicIpAddress: 'true' #auto

AWS: How to enable CORS in API Gateway using Cloudformation?

ⅰ亾dé卋堺 提交于 2019-12-11 17:08:59
问题 I have a sample template, which is creating an AWS Lambda function and an API Gateway, The issue that I'm facing is the template is able to enable CORS, but it seems to be wrong as on calls from a frontend application still receive the CORS error. Following is the template - AWSTemplateFormatVersion: '2010-09-09' Description: AWS API Gateway with a Lambda Integration Parameters: CorsOrigin: Type: String Default: "'*'" CorsHeaders: Type: String Default: "'Content-Type,X-Amz-Date,Authorization

setting the widget for cloudwatch dashboard. Getting the error “The dashboard body is invalid, there are 1 validation errors”

我的未来我决定 提交于 2019-12-11 15:56:08
问题 I am not able to ref servicename in the widget. Getting the following error with the given code: The dashboard body is invalid, there are 1 validation errors: [ { "dataPath": "/widgets/0/properties/metrics/0", "message": "Should NOT have more than 3 items" } ] (Service: AmazonCloudWatch; Status Code: 400; Error Code: InvalidParameterInput "CloudwatchDashboard": { "Type": "AWS::CloudWatch::Dashboard", "Properties": { "{ \"widgets\": [{ \"type\":\"metric\", \"x\":0, \"y\":0, \"width\":12, \

AWS AMI Automation using Jenkins and Cloud Formation

安稳与你 提交于 2019-12-11 15:50:00
问题 Now, i'm creating AWS AMI manually from an EC2 instance. and i would like to automate the process using Jenkins build process. I've configured the jenkins-cloudformation plugin with the credentials and tried to trigger the cloud formation template to launch the EC2 instance. From here how can i proceed the automation process to create the AMI with in the cloud formation template? Can someone help me on this? 来源: https://stackoverflow.com/questions/48857030/aws-ami-automation-using-jenkins-and

Optional parameters when using AWS CLI to launch CloudFormation template

。_饼干妹妹 提交于 2019-12-11 15:42:49
问题 I'm trying to create a CloudFormation template that'll deploy a Lambda function, And I need the security options to be optional parameters. I was able to partially accomplish this using the question here: How to make a whole object in CloudFormation templates optional? Interestingly, that method worked great to make the VpcConfig property optional in the AWS GUI Console, but it did NOT work to make it optional for the CLI. And unfortunately, I need it to work in the CLI, since I'll be using

How To Extract Load Balancer Name from Elastic Beanstalk Environment in CloudFormation

最后都变了- 提交于 2019-12-11 15:19:25
问题 I have created a Elastic Beanstalk and CloudWatch Alarm in CloudFormation with the following code snippet: "ElasticBeanstalkEnvironment": { "Type": "AWS::ElasticBeanstalk::Environment", "Properties": { "ApplicationName": "my-app", "EnvironmentName": "my-eb", "SolutionStackName": "64bit Amazon Linux 2018.03 v3.0.1 running Tomcat 8 Java 8", "OptionSettings": [ { "Namespace": "aws:elb:loadbalancer", "OptionName": "CrossZone", "Value": "true" }, { "Namespace": "aws:elb:listener:80", "OptionName":

AWS CloudFormation Template - How to configure Lambda with a SQS queue to pick the item from queue

笑着哭i 提交于 2019-12-11 14:59:58
问题 I am pretty new in AWS CloudFormaton template creation. Could not able to find the way to create a Lambda function which will connect with the SQS queue. Any example or resource would help me to learn and implement. 回答1: You need: AWS::SQS::Queue AWS::Lambda::Function AWS::Lambda::EventSourceMapping "DequeueInstanceQueue": { "Type": "AWS::SQS::Queue", "Properties": { "VisibilityTimeout": 301 }, "DeletionPolicy": "Delete" }, "DequeueInstanceMapping": { "Type": "AWS::Lambda::EventSourceMapping"

Connecting a SSL cert to a CloudFront CDN in CloudFormation

血红的双手。 提交于 2019-12-11 14:40:10
问题 So far I have this to create the resources. "staticFileBucketPolicy": { "Type": "AWS::S3::BucketPolicy", "DependsOn": "staticFileBucket", "Properties": { "Bucket": { "Ref": "staticFileBucket" }, "PolicyDocument": { "Version": "2012-10-17", "Statement": [{ "Sid": "AddPerm", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "staticFileBucket" } , "/*" ]]} }] } } }, "certificate": { "Type": "AWS::CertificateManager: