amazon-cloudformation

Cloudformation Bucket Policy - “Statement is missing required element”

谁都会走 提交于 2019-12-06 13:32:59
I have this S3 Bucket and Policy that I am deploying to CloudFormation. Resources: ReportsBucket: Type: AWS::S3::Bucket BucketPolicy: Type: AWS::S3::BucketPolicy Properties: Bucket: !Ref ReportsBucket PolicyDocument: Id: ReportPolicy Version: "2012-10-17" Statement: - Sid: ReportBucketPolicyDoc Effect: Allow Action: "s3:*" Principal: AWS: !Join ['', ["arn:aws:iam::", !Ref "AWS::AccountId", ":root"]] Resource: !Join ['', ['arn:aws:s3:::', !Ref S3Bucket, '/*']] It fails with, UPDATE_ROLLBACK_IN_PROGRESS AWS::CloudFormation::Stack {my stack name} The following resource(s) failed to create:

CloudFormation - Security Group VPC issue

故事扮演 提交于 2019-12-06 13:26:57
I have a template which creates an ELB and attaches an existing subnet within a VPC. This creates just fine but when I then update my stack and add a security group with a VpcId property with a value equal to the existing VPC ID in which my attached subnet belongs the stack fails with the following error: "You have specified two resources that belong to different networks" If I remove the VpcId property from my security group it creates it in my default VPC and the stack creation works. I cannot understand why this can be because the security group has a relationship to the ELB in the

Cloudformation template to trigger Lambda on S3 event

試著忘記壹切 提交于 2019-12-06 11:58:14
I want to use Cloudformation to create an S3 bucket that will trigger Lambda function whenever an S3 event occurs such as file creation, file deletion, etc. From my research, I have my AWS::Lambda::Function and AWS::S3::Bucket setup, AWSTemplateFormatVersion: '2010-09-09' Resources: HandleFileCreation: Type: "AWS::Lambda::Function" Properties: ... LambdaExecutionRole: Type: AWS::IAM::Role Properties: ManagedPolicyArns: - arn:aws:iam::aws:policy/AmazonS3FullAccess - arn:aws:iam::aws:policy/AWSLambdaFullAccess AssumeRolePolicyDocument: ... ReportsBucket: Type: AWS::S3::Bucket BucketPolicy: Type:

How pass output values between aws nested stacks in serverless?

半城伤御伤魂 提交于 2019-12-06 09:40:41
Here is readme about serverless-plugin-nested-stacks plugin. It makes possible to include nested stacks into main one. But how to pass values between stacks? For example I create a resouce in one nested stack - how to path it arn to another stack (nested or main one)? First you will need to export the resources from the corresponding nested stack like this: AWSTemplateFormatVersion: '2010-09-09' Parameters: ... Resources: ... Outputs: o1: Description: ... Value: <your_resource_arn> Export: Name: <your_export_name> To import the resource in other stack, you will need to use the intrinsic

AWS Cloudformation: Loadbalancer Custom SSL Negotiation Policy

落爺英雄遲暮 提交于 2019-12-06 08:03:15
问题 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

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

↘锁芯ラ 提交于 2019-12-06 07:24:17
问题 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

Pass stack tags to nested stack in Cloudformation

ぃ、小莉子 提交于 2019-12-06 07:21:46
问题 I'm easily able to pass parameters to a Nested Cloudformation Stack using AWS::CloudFormation::Stack , including referenced values: "MyNestedStack" : { "Type" : "AWS::CloudFormation::Stack", "Condition" : "MyCondition", "Properties" : { "TemplateURL" : { "Fn::Join" : ["", ["https://mybucket.s3.amazonaws.com/", { "Ref" : "S3BucketLocation" }, "/MyNestedStack.template"]] }, "Parameters": { "MyVPC" : { "Ref" : "VPC" }, "MySubnet" : { "Ref" : "ManagementSubnet" }, "MySubnetAZ" : { "Fn::GetAtt" :

Loading CloudFormation YAML using Python

限于喜欢 提交于 2019-12-06 06:31:53
问题 I've got a set of YAML AWS Cloud Formation Templates that I've recently converted from JSON . When using JSON I was able to load these templates and transform them using jinja to generate some markdown documentation from them. I'm attempting to do the same with YAML in python. I'm using the shorthand function syntax in the cloudformation templates which uses the YAML Tags. eg Properties: MinSize: !Ref ClusterSize MaxSize: !Ref ClusterSize When attempting to load these with the ruamel.yaml

AWS Lambda in VPC sometimes doesn't have internet access

99封情书 提交于 2019-12-06 06:30:38
I have Lambda which was deployed to VPC. This deploymens has next configs: VPC (192.168.0.0/16) Public Subnet A (192.168.32.0/20) has NAT Gateway and Route 0.0.0.0/0 to Internet Gateway Private Subnet A (192.168.48.0/20) has Route 0.0.0.0/0 to NAT Gateway Private Subnet B (192.168.64.0/20) Lambda has own Securiy Group and references to "Private Subnet A" and "Private Subnet B" I have strange problem: time to time Lambda doesn't have Internet Access . 3rd party service works normal. One more strange thing that Lambda gets IP's like 127.0.0.1, 169.254.76.13, 169.254.79.1 instead of IP's from

Required Cloudformation Script for Blue/Green deployment on ECS

一个人想着一个人 提交于 2019-12-06 06:28:49
I am trying to write a cloud-formation template for AWS ECS with blue green deployment support . This blue-green feature was added recently by AWS in ECS and couldn't find any reference for updating it in cloud-formation template. They have given documentation on, how to do it through UI but not through cloud-formation. I guess, AWS might not updated their cloud-formation documentation as it is a new feature. Any help to find the documentation would be appreciated. Thanking you in advance. Currently cloudformation does not support the DeploymentController parameter in which you can specify