Skip to content

Commit 6760550

Browse files
authored
Merge pull request #6 from fabidick22/multiple-enironment-support
Multiple environment support
2 parents 433fdf8 + cc98f36 commit 6760550

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

samconfig.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ version = 0.1
22
[default]
33
[default.deploy]
44
[default.deploy.parameters]
5+
s3_bucket = "aws-sam-cli-managed-default-samclisourcebucket-b5rkcqqppiqc"
56
region = "us-east-2"
67
confirm_changeset = true
7-
capabilities = "CAPABILITY_IAM"
8-
parameter_overrides = "Environment=\"stage\""
9-
8+
capabilities = "CAPABILITY_IAM"

template.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Globals:
2727
Resources:
2828
ServerlessHTTPApi:
2929
Type: AWS::Serverless::HttpApi
30+
Properties:
31+
StageName: !Sub "${Environment}"
3032

3133
HelloWorldFunction:
3234
Type: AWS::Serverless::Function
@@ -45,7 +47,11 @@ Resources:
4547
Outputs:
4648
HelloWorldApi:
4749
Description: "API Gateway endpoint URL for Prod stage for Hello World function"
48-
Value: !Sub "https://${ServerlessHTTPApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/"
50+
Value: !Join
51+
- ''
52+
- - !Sub "https://${ServerlessHTTPApi}.execute-api.${AWS::Region}.amazonaws.com/"
53+
- !If [ProdCondition, "prod", "stage"]
54+
4955
HelloWorldFunction:
5056
Description: "Hello World Lambda Function ARN"
5157
Value: !GetAtt HelloWorldFunction.Arn

0 commit comments

Comments
 (0)