Last active
October 8, 2019 15:40
-
-
Save alexcasalboni/23efcacf7b5164f3ef01edbc8770266f to your computer and use it in GitHub Desktop.
AWS CodePilpeline - Lambda stage (YAML)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion : '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Resources: | |
myPipelineFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: index.handler | |
Policies: | |
- AWSLambdaExecute # Managed Policy | |
- Version: '2012-10-17' # Policy Document | |
Statement: | |
- Effect: Allow | |
Action: | |
- codepipeline:PutJobSuccessResult | |
- codepipeline:PutJobFailureResult | |
Resource: '*' | |
# ... | |
# all the other properties here | |
# ... | |
myPipelineLambdaPermission: | |
Type: AWS::Lambda::Permission | |
Properties: | |
FunctionName: !Ref myPipelineFunction | |
Action: lambda:InvokeFunction | |
Principal: | |
Service: 'codepipeline.amazonaws.com' | |
SourceAccount: !Ref 'AWS::AccountId' | |
SourceArn: !GetAtt myPipeline.Arn | |
myPipeline: | |
Type: AWS::CodePipeline::Pipeline | |
Properties: | |
ArtifactStore: | |
Type: S3 | |
Location: my-pipeline-bucket | |
RoleArn: !Ref MyIAMRoleForCodePipeline | |
Stages: | |
- ... OTHER STAGES HERE (deploy the website) ... | |
- Name: myCustomStage | |
Actions: | |
- ActionTypeId: | |
Category: Invoke | |
Owner: AWS | |
Provider: Lambda | |
Version: '1.0' | |
Configuration: | |
FunctionName: !Ref myPipelineFunction | |
UserParameters: 'http://mywebsite.com' | |
Name: Lambda | |
outputArtifacts: [] | |
inputArtifacts: [] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment