amazon-cloudformation

CloudFormation, passing a List<AWS::EC2::Subnet::Id> parameter as a comma separated string?

混江龙づ霸主 提交于 2019-12-11 05:29:55
问题 How can I pass a parameters of type List<AWS::EC2::Subnet::Id> as a comma separated string? I have the following template: { "AWSTemplateFormatVersion": "2010-09-09", "Parameters": { "PrivateSubnets": { "Description": "The private subnets in which Beanstalk EC2 instances will created", "Type": "List<AWS::EC2::Subnet::Id>" }, "PublicSubnets": { "Description": "The public subnets in which the Beanstalk ELBs will be created", "Type": "List<AWS::EC2::Subnet::Id>" } }, "Resources": { "MyApp": {

CloudFormation Magic to Generate A List of ARNs from a List of Account Ids

孤街浪徒 提交于 2019-12-11 04:36:40
问题 In my template, I am passing a CommaDelimitedList of account ids as a parameter. I am hoping to do some Fn::Join and/or Fn::Sub magic to transform the list as follow: "Accounts" : { "Type" : "CommaDelimitedList", "Default" : "12222234,23333334,1122143234,..." } To be used in the template as a list `root` ARN's as : [ "arn:aws:iam::12222234:root" "arn:aws:iam::23333334:root" "arn:aws:iam::1122143234:root" ] Right now I am passing in the full ARNs, so it's working, but it is kluncky. However

Reading a secret using CloudFormation

自作多情 提交于 2019-12-11 04:32:41
问题 I am trying to create an AWS stack in CloudFormation having a secret in the JSON. I don't want the value of the secret displayed in the parameters and I don't want my instance (fargate or ec2) to access the secrets manager. I want CloudFormation to retrieve the value from the secrets manager and inject it in the template during runtime. This is what I did: Create a secret Create a template using Designer Read the secret and create a resource. In this case I am creating a bucket that has as a

AWS ECS: Severe bug in ECS Service Cloudformation template

佐手、 提交于 2019-12-11 04:13:35
问题 Trying to create an ECS service using cloudformation via the following manifest that has the appropriate imports UIService: Type: AWS::ECS::Service Properties: Cluster: !ImportValue ECSClusterName DesiredCount: 1 LaunchType: EC2 LoadBalancers: - ContainerName: !ImportValue UIContainerName ContainerPort: '80' TargetGroupArn: !ImportValue UITGArn ServiceName: ui-service ServiceRegistries: - RegistryArn: arn:aws:servicediscovery:eu-west-1:944094092130:service/srv-oIclu40KCKM3esez7 TaskDefinition

Start Cloudformation stacks in parallel from ansible

邮差的信 提交于 2019-12-11 04:08:13
问题 I am starting multiple cloudformation stacks in a "with_items" loop in ansible like this: - name: Create CF stack in AWS cloudformation: stack_name: "{{ item.name }}" state: "present" template: "{{ item.name }}.py.json" template_parameters: "{{ item.template_parameters }}" with_items: "{{ CF_TEMPLATE_ITEMS }}" Can I somehow make ansible start this stacks in parallel? 回答1: Using asynchronous tasks in a fire-and-forget scheme (and waiting for them to finish in a separate task) should work since

Allow every instance in the same Security Group to share any data between each other at Cloud Formation JSON?

ぃ、小莉子 提交于 2019-12-11 04:07:16
问题 I'm building a Cloud Formation JSON to define EC2 Instances and Security Groups. I need to create a security Group that allows every instance that belongs in it to share any data between each other. My JSON was like that: "InternalSecurityGroup" : { "Type" : "AWS::EC2::SecurityGroup", "Properties" : { "VpcId" : {"Ref" : "myVPC"}, "GroupDescription" : "Allow the machines in this group to share all kinds of traffic between each other", "SecurityGroupIngress" : [ { "IpProtocol" : "-1", "FromPort

AWS Cloudformation : Passing environmental variables as parameters to lambda functions

我的未来我决定 提交于 2019-12-11 03:06:54
问题 I am creating a cloud formation for lambda . I want to have a generic lambda script that created lambda . I am having problem injecting "Environment" parameter from outside . I want to pass the key value pair object as parameter . Can some one tell me how to do it . I have highlighted it below { "Variables" : **{ String:String, ... }** } { "Type" : "AWS::Lambda::Function", "Properties" : { "Code" : Code, "DeadLetterConfig" : DeadLetterConfig, "Description" : String, "Environment" :

Setting a dynamic hostname on AWS using UserData

爱⌒轻易说出口 提交于 2019-12-11 02:57:04
问题 I have a bit of a chicken and egg problem. I would like to set the Hostname during instance launch using UserData , but I need it to be an incremental one, such as myapp01.us-west-2c.company.com myapp02.us-west-2c.company.com The AWS::AutoScaling::LaunchConfiguration can do this I believe for the key/tag pairs for Name . However, how can I get UserData to do something similar? 来源: https://stackoverflow.com/questions/40917209/setting-a-dynamic-hostname-on-aws-using-userdata

Terraform - Specifying multiple possible values for Variables

微笑、不失礼 提交于 2019-12-11 01:19:24
问题 CloudFormation provides AllowedValues for Parameters which tells that the possible value of the parameter can be from this list. How can I achieve this with Terraform variables? The variable type of list does not provide this functionality. So, in case I want my variable to have value out of only two possible values, how can I achieve this with Terraform. CloudFormation script that I want to replicate is: "ParameterName": { "Description": "desc", "Type": "String", "Default": true,

Lambda can not access RDS though those are in the same VPC

吃可爱长大的小学妹 提交于 2019-12-11 00:47:26
问题 I have created VPC and RDS with the below CloudFormation . Resources: TestVpc: Type: "AWS::EC2::VPC" Properties: CidrBlock: "10.0.0.0/16" EnableDnsSupport: true EnableDnsHostnames: true TestSubnetA: Type: "AWS::EC2::Subnet" Properties: AvailabilityZone: "ap-northeast-1a" CidrBlock: "10.0.0.0/20" VpcId: !Ref TestVpc TestSubnetB: Type: "AWS::EC2::Subnet" Properties: AvailabilityZone: "ap-northeast-1d" CidrBlock: "10.0.16.0/20" VpcId: !Ref TestVpc TestSubnetC: Type: "AWS::EC2::Subnet" Properties