amazon-cloudformation

Create AWS Athena view programmatically

强颜欢笑 提交于 2019-12-13 11:46:37
问题 Can you create views in Amazon Athena? outlines how to create a view using the User Interface. I'd like to create an AWS Athena View programatically, ideally using Terraform (which calls CloudFormation). I followed the steps outlined here: https://ujjwalbhardwaj.me/post/create-virtual-views-with-aws-glue-and-query-them-using-athena, however I run into an issue with this in that the view goes stale quickly. ...._view' is stale; it must be re-created. The terraform code looks like this:

how to add multiple ec2 instances inside aws stack

痞子三分冷 提交于 2019-12-13 09:51:56
问题 I want to create an AWS stack through portal or through cloud formation. But I want to add multiple EC2 instances in one single stack. I am not finding enough examples. How can I find one ? 回答1: Just add more AWS::EC2::Instance resource into your CloudFormation template. For example: { "AWSTemplateFormatVersion": "2010-09-09", "Description": "Ec2 block device mapping", "Resources": { "MyEC2Instance1": { "Type": "AWS::EC2::Instance", "Properties": { "ImageId": "ami-79fd7eee", "KeyName":

How to connect to Ethereum URLs created using AWS blockchain template

白昼怎懂夜的黑 提交于 2019-12-13 08:55:58
问题 I've just finished setting up a Ethereum Stack using the AWS Blockchain Template according to the docs here I've sshed to the EC2 instance (bastion host) from my local machine and I can hit the EthStats URL via curl from the bastion host but when I try to go tot he url from chrome, it gives 'This site can’t be reached' error, even though I've setup a FireProxy as per the instructions in the docs. How do I connect to the Ethereum URLs given in outputs of my Ethereum stack in the AWS

How to assign a policy to adhoc user?

风流意气都作罢 提交于 2019-12-13 03:49:06
问题 Background: With cross account role someaccountrole , I have access to aws account xyz . Case 1 To create a stack in account xyz , we upload the Cloudformation file through console. Amidst stack creation in Events tab, we see the very first event, as shown below: Case 2 We create EC2 instance in xyz account. Using sam deploy, where sam deploy is a wrapper of aws cloudformation deploy , we run below command from EC2, for stack creation: aws cloudformation deploy --template-file cfntemplate.yml

CloudFormation typed parameter that can be empty

*爱你&永不变心* 提交于 2019-12-13 03:47:49
问题 I am trying to create a CloudFormation template that accepts an optional SSH key pair as a parameter. I want to use the AWS::EC2::KeyPair::KeyName type so the CloudFormation interface gives the user a list of available keys like in the picture. The problem I'm having is with the optional part. If the user leaves the selection empty, the default value is used but is not considered valid. I get: Parameter validation failed: parameter value for parameter name SSHKey does not exist. Rollback

AWS Cloudformation, Output value from Custom Resource

Deadly 提交于 2019-12-13 03:13:35
问题 I wanted to output a value I get form an Cloudformation Custom Resource. I'm definitely returning the value, but I wasn't sure how to reference it in an Output This is my template.yml: Outputs: customresourceoutput: Value: !GetAtt creates3bucketlambda.myvalue Resources: creates3bucketlambda: Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: nodejs6.10 CodeUri: setups3bucket MemorySize: 512 Timeout: 300 Policies: - AWSLambdaBasicExecutionRole - AmazonS3FullAccess

AWS ECS Service Definition: Role property

杀马特。学长 韩版系。学妹 提交于 2019-12-13 02:58:24
问题 I am setting up an AWS ECS Service using cloudformation and yaml syntax. At some point, in the relevant documentation there is a property called Role whose definitions is the following: Role The name or ARN of an AWS Identity and Access Management (IAM) role that allows your Amazon ECS container agent to make calls to your load balancer. Note In some cases, you might need to add a dependency on the service role's policy. For more information, see IAM role policy in DependsOn Attribute.

Lambda-Backed Custom Resource

末鹿安然 提交于 2019-12-13 01:18:10
问题 I'm trying to create a custom resource in a CFT that will run a lambda function on creation of said template. I've looked at the AWS documentation for Lambda-Backed Custom Resources, but I'm still a bit confused on the topic as the documentation was not particularly verbose. I've included the JSON for my custom resource, and I'm just wondering if there's anything else I have to do in order to ensure that this resource will call on the function upon creating the template. "LambdaRunner": {

how do you output api resource arns from AWS::Serverless::Function (SAM)?

假装没事ソ 提交于 2019-12-12 19:26:46
问题 I need to access the arn of a gateway that has been created and subscribed to using a Cloudformation SAM template. When I try the following, I get an error 'Unresolved resource dependencies [GetResource] in the Outputs block.' AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: TestFunction: Type: AWS::Serverless::Function Properties: CodeUri: dist Handler: index.handler Events: GetResource: Type: Api Properties: Path: /path Method: get Outputs: ReadApi:

Autoscaling across multiple subnets using AWS Cloudformation throws error

邮差的信 提交于 2019-12-12 19:16:31
问题 I am unable to create a Cloudformation template to autoscale across 2 different public subnets. I keep getting the error CREATE_FAILED AWS::AutoScaling::AutoScalingGroup The availability zones of the specified subnets and the Auto Scaling group do not match I have extensively researched all the different template code possibilities and I've tried them all, including Defining the exact AZs like this: AvailabilityZones" : [ us-west-2a, us-west-2b ], Using the VPCZone Identifier property instead