amazon-cloudformation

How to pass yamel file content to cloud formation nested stack?

故事扮演 提交于 2020-01-06 18:42:18
问题 I tried this in many ways: aws cloudformation deploy --stack-name agent-prod --template-file prod-agent.yaml --region eu-central-1 --parameter-overrides ConfigFile="$(cat config.yaml)" and aws cloudformation deploy --stack-name agent-prod --template-file prod-agent.yaml --region eu-central-1 --parameter-overrides ConfigFile=fileb://config.yaml but it didn't work. is there a good way and known to do that? 回答1: You can't currently pass your parameters in YAML format. It's a commonly requested

Adding S3 trigger to Lambda function using CloudFormation

若如初见. 提交于 2020-01-06 09:03:13
问题 I'm trying to add an S3 trigger to a lambda function using CloudFormation. From what I've read about circular references the lambda function and S3 bucket needs to be created first, which I've done with a template and they get created successfully. Then I go into "Update Stack" and enter the template: "Resources": { "MyBucket": { "Type": "AWS::S3::Bucket", "NotificationConfiguration": { "LambdaConfigurations": [ { "Event": "s3:ObjectCreated:*", "Function": "arn:aws:lambda:ap-southeast-2

Spring Cloud Netflix | Eureka not registering when deployed on ECS

北战南征 提交于 2020-01-06 08:47:10
问题 I am trying to deploy Spring Netflix Eureka and related microservice application using ECS and Cloudformation. Eureka is not able to register the related microservices because the docker images are not able to link on hostname. Please suggest what should be the best solution to handle this. 回答1: You should use EC2 instance's host ip instead of docker container host's. In your microservices (if those are spring boot applications), put this code: @Bean @Profile("docker") public

Swagger file with AWS Extensions stored in S3 Bucket for API Creation with Cloudformation

…衆ロ難τιáo~ 提交于 2020-01-06 08:28:12
问题 I'm trying to create an API Gateway using a Cloudformation template like this: Resources: InvoiceApi: Type: AWS::ApiGateway::RestApi Properties: Description: an Api for our Invoicegen App Name: !Ref ApiName ApiKeySourceType: !Ref ApiKeySourceType BinaryMediaTypes: - !Ref binaryMediaType1 - !Ref binaryMediaType2 BodyS3Location: Bucket: Fn::ImportValue: !Sub ${EnvironmentName}-SwaggerApiBucket-Name Key: swaggertest.yaml ETag: !Ref ETag EndpointConfiguration: Types: - REGIONAL FailOnWarnings:

CloudFormation - Partitioning EBS root volume

一个人想着一个人 提交于 2020-01-06 08:06:14
问题 Below is the cloudformation template to create EC2 instance: "EC2Instance":{ "Type": "AWS::EC2::Instance", "Properties":{ "ImageId": "ami-099999999999a27", "InstanceType": "t2.micro", "SubnetId": { "Ref": "SubnetId"}, "KeyName": { "Ref": "KeyName"}, "SecurityGroupIds": [ { "Ref": "EC2InstanceSecurityGroup"} ], "IamInstanceProfile": { "Ref" : "EC2InstanceProfile"}, "UserData":{ "Fn::Base64": { "Fn::Join": ["", [ "#!/bin/bash\n", "echo ECS_CLUSTER=", { "Ref": "EcsCluster" }, " >> /etc/ecs/ecs

CloudWatch Event that targets SQS Queue fails to work

北战南征 提交于 2020-01-06 07:09:37
问题 According to this article it's possible to set SQS as target for scheduled CloudWatch event: https://aws.amazon.com/ru/about-aws/whats-new/2016/03/cloudwatch-events-now-supports-amazon-sqs-queue-targets/ I've created a simple Cloud Formation template that aims to trigger CloudWatch event each minute so the new message should appear in SQS , but something is missing as there are no messages in SQS . The code: { "AWSTemplateFormatVersion": "2010-09-09", "Description": "stack 1", "Parameters": {

Who stops and starts the ECS task? and informs ECS service

淺唱寂寞╮ 提交于 2020-01-06 04:51:11
问题 Below is the ECS task definition for an application: SomeappTaskDefinition: Type: "AWS::ECS::TaskDefinition" Properties: ContainerDefinitions: - Name: someapp Image: someaccounthub/someapp Memory: 450 Environment: - Name: DJANGO_SETTINGS_MODULE Value: someapp.settings.release - Name: MYSQL_HOST Value: { "Fn::GetAtt": ["DbInstance", "Endpoint.Address"] } - Name: MYSQL_USER Value: { "Ref": "DbUsername" } - Name: MYSQL_PASSWORD Value: { "Ref": "DbPassword" } MountPoints: - ContainerPath: /var

Adding Lambda@edge includebody field in cloudfront using cloudformation template?

帅比萌擦擦* 提交于 2020-01-06 03:54:22
问题 I am trying to add Lambda@Edge association in cloudfront using cloudformation. As per aws docs they had only two fields like EventType and LambdaFunctionARN . But i want to add IncludeBody in cloudformation so that my Lambda@Edge will read the body of the request . When i try to add IncludeBody in cloudformation it is saying error like invalid property . "LambdaFunctionAssociations": [ { "EventType": "origin-response", "IncludeBody":"true" -- Invalid property error "LambdaFunctionARN": "arn

Unable to write policy document in aws cdk using python

给你一囗甜甜゛ 提交于 2020-01-05 07:16:12
问题 Hi I am working on AWS CDK. I am trying to create policy. Below is my code. MWSECSServiceRole = iam.Role(self, 'MWSECSServiceRole', assumed_by=iam.ServicePrincipal('ecs.amazonaws.com')) MWSECSServiceRole.add_to_policy(iam.PolicyStatement( effect=iam.Effect.ALLOW, resources=["arn:aws:elasticloadbalancing:*:{AccountId}:loadbalancer/app/mws-*","arn:aws:elasticloadbalancing:*:{AccountId}:listener-rule/app/mws-*","arn:aws:elasticloadbalancing:*:{AccountId}:listener/app/mws-*","arn:aws

using Cloudformation ref with awscli in userData

旧巷老猫 提交于 2020-01-04 09:18:08
问题 "aws ec2 create-tags --resources xxxxxx --tags Key=Team,Value=everybody --region { \"Ref\" : \"region\" } --out text\n" The above line/command I am using in my Cloudformation userData, It is not getting executed , I am getting the following error when I debugged : aws: error: argument --region: Invalid choice, valid choices are: ap-southeast-1 | us-gov-west-1 ap-northeast-1 | eu-west-1 fips-us-gov-west-1 | us-west-1 us-west-2 | us-east-1 cn-north-1 | ap-southeast-2 sa-east-1 My region name is