Skip to content

Commit

Permalink
Update not Replace envVars
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPates committed Jan 23, 2023
1 parent 4425e6d commit c71ccce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cicd/EnvVarConfig/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ phases:
build:
commands:
# Set the Environment Variable to enable CodePipeline
aws lambda update-function-configuration --function-name SSOSyncFunction --environment "Variables={RUNNING_IN_CODEPIPELINE=True}" --query "Environment"
- NEW_ENVVARS=$(aws lambda get-function-configuration --function-name SSOSyncFunction --query "Environment.Variables | merge(@, \`{\"RUNNING_IN_CODEPIPELIN\":\"True\"}\`)")
- aws lambda update-function-configuration --function-name SSOSyncFunction --environment "{ \"Variables\": $NEW_ENVVARS }"



6 changes: 4 additions & 2 deletions cicd/cloudformation/dev-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ Resources:
- !Sub ${CodeBuildPackage.Arn}
- !Sub ${CodeBuildDeploy.Arn}
- !Sub ${CodeBuildStaging.Arn}
- !Sub ${CodeBuildEnvVarConfig.Arn}
- !Sub ${CodeBuildE2ETest.Arn}
Effect: Allow
- Action:
Expand Down Expand Up @@ -880,9 +881,10 @@ Resources:
- !Sub arn:aws:iam::${AWS::AccountId}:role/CodePipelineCloudFormationRole
Effect: Allow
- Action:
- 'lambda:invoke'
- 'lambda:invoke'
- 'lambda:UpdateFunctionConfiguration'
Effect: Allow
Resource: '*'
Resource: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:SSOSyncFunction

CodePipelineCloudFormationRole:
Type: AWS::IAM::Role
Expand Down

0 comments on commit c71ccce

Please sign in to comment.