amazon-cloudformation

Fix CORS “Response to preflight…” header not present with AWS API gateway and amplify

∥☆過路亽.° 提交于 2020-08-27 08:24:29
问题 I've been struggling so long with the error below. I've tried so many tutorials and stackoverflow answers and none of the solutions fixes my problem. Access to XMLHttpRequest at 'https://xxx' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. I'm using SAM serverless to create my api. template.yaml: Globals: Function: Timeout: 10 Api:

How to specify JSON-formatted string in Cloudformation?

江枫思渺然 提交于 2020-08-24 05:30:10
问题 I have the following resource on my CloudFormation template to create a rule to run a Lambda function, from the AWS documentation: "ScheduledRule": { "Type": "AWS::Events::Rule", "Properties": { "Description": "ScheduledRule", "ScheduleExpression": "rate(5 minutes)", "State": "ENABLED", "Targets": [{ "Arn": { "Fn::GetAtt": ["myLambda", "Arn"] }, "Id": "TargetFunctionV1" }] } } I would like to specify the Input: { "Arn" : String, "Id" : String, "Input" : String, "InputPath" : String } and

How to specify JSON-formatted string in Cloudformation?

半世苍凉 提交于 2020-08-24 05:30:05
问题 I have the following resource on my CloudFormation template to create a rule to run a Lambda function, from the AWS documentation: "ScheduledRule": { "Type": "AWS::Events::Rule", "Properties": { "Description": "ScheduledRule", "ScheduleExpression": "rate(5 minutes)", "State": "ENABLED", "Targets": [{ "Arn": { "Fn::GetAtt": ["myLambda", "Arn"] }, "Id": "TargetFunctionV1" }] } } I would like to specify the Input: { "Arn" : String, "Id" : String, "Input" : String, "InputPath" : String } and

AWS CloudFormation error with network interface

六眼飞鱼酱① 提交于 2020-08-11 02:10:32
问题 I get this error whenever I launch my stack (Network interfaces and an instance-level security groups may not be specified on the same request (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID:....)) and the status in Aws console is: ROLLBACK_COMPLETE How I can solve this error? EC2Instance: Type: 'AWS::EC2::Instance' Properties: SecurityGroups: - !Ref SecurityGroup KeyName : !Ref EC2Key AvailabilityZone: us-east-2a ImageId: ami-01410f0e8f8b1acca

AWS CloudFormation error with network interface

*爱你&永不变心* 提交于 2020-08-11 02:09:34
问题 I get this error whenever I launch my stack (Network interfaces and an instance-level security groups may not be specified on the same request (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID:....)) and the status in Aws console is: ROLLBACK_COMPLETE How I can solve this error? EC2Instance: Type: 'AWS::EC2::Instance' Properties: SecurityGroups: - !Ref SecurityGroup KeyName : !Ref EC2Key AvailabilityZone: us-east-2a ImageId: ami-01410f0e8f8b1acca

AWS CloudFormation - Create Tables After RDS Instance Is Ready?

匆匆过客 提交于 2020-07-29 12:59:08
问题 CloudFormation amateur here. Been looking online and can't find any references as to how I would go about creating my tables after my RDS instance is stood up through CloudFormation. Is it possible to specify a Lambda to launch and create all the tables, or maybe specify a SQL file to be applied? What's the standard pattern on this? 回答1: There aren't any CloudFormation resources which deal with the 'internals' of an RDS instance once it's been created; it's a black box which you're expected

Uppercase and lowercase substitution with Fn::Sub

好久不见. 提交于 2020-07-23 08:09:29
问题 I have a parameterized S3 path (different per environment) that looks something like this example: Environment: - Name: 'Environment' Value: !Ref Environment - Name: SERVICE_LOGIN_KEYSTORE Value: !Sub s3://${Environment}-productsuite-cert/productsuite-pipelinename-${Environment}.jks The issue is that the actual path has the first ${Environment} in lowercase while the second in uppercase, e.g: s3://qa-productsuite-cert/productsuite-pipelinename-QA.jks s3://pr-productsuite-cert/productsuite

Uppercase and lowercase substitution with Fn::Sub

穿精又带淫゛_ 提交于 2020-07-23 08:07:25
问题 I have a parameterized S3 path (different per environment) that looks something like this example: Environment: - Name: 'Environment' Value: !Ref Environment - Name: SERVICE_LOGIN_KEYSTORE Value: !Sub s3://${Environment}-productsuite-cert/productsuite-pipelinename-${Environment}.jks The issue is that the actual path has the first ${Environment} in lowercase while the second in uppercase, e.g: s3://qa-productsuite-cert/productsuite-pipelinename-QA.jks s3://pr-productsuite-cert/productsuite

How to append a list in CloudFormation

痴心易碎 提交于 2020-07-22 21:34:25
问题 In CloudFormation, how can I append a list? Tried: !Join [ ",", [ !Ref ListParam, !Ref StringParam ]] but got an error: A client error (ValidationError) occurred when calling the ValidateTemplate operation: Template error: every Fn::Join object requires two parameters, (1) a string delimiter and (2) a list of strings to be joined or a function that returns a list of strings (such as Fn::GetAZs) to be joined. 回答1: First, we need to know what do you want to achieve. If you want to append new a