{
  "Resources": {
    "PipelineArtifactsBucket22248F97": {
      "Type": "AWS::S3::Bucket",
      "DeletionPolicy": "Retain"
    },
    "PipelineRoleD68726F7": {
      "Type": "AWS::IAM::Role",
      "Properties": {
        "AssumeRolePolicyDocument": {
          "Statement": [
            {
              "Action": "sts:AssumeRole",
              "Effect": "Allow",
              "Principal": {
                "Service": "codepipeline.amazonaws.com"
              }
            }
          ],
          "Version": "2012-10-17"
        }
      }
    },
    "PipelineRoleDefaultPolicyC7A05455": {
      "Type": "AWS::IAM::Policy",
      "Properties": {
        "PolicyDocument": {
          "Statement": [
            {
              "Action": [
                "s3:GetObject*",
                "s3:GetBucket*",
                "s3:List*",
                "s3:PutObject*",
                "s3:DeleteObject*",
                "s3:Abort*"
              ],
              "Effect": "Allow",
              "Resource": [
                {
                  "Fn::GetAtt": [
                    "PipelineArtifactsBucket22248F97",
                    "Arn"
                  ]
                },
                {
                  "Fn::Join": [
                    "",
                    [
                      {
                        "Fn::GetAtt": [
                          "PipelineArtifactsBucket22248F97",
                          "Arn"
                        ]
                      },
                      "/",
                      "*"
                    ]
                  ]
                }
              ]
            },
            {
              "Action": [
                "s3:GetObject*",
                "s3:GetBucket*",
                "s3:List*"
              ],
              "Effect": "Allow",
              "Resource": [
                {
                  "Fn::GetAtt": [
                    "PipelineBucketB967BD35",
                    "Arn"
                  ]
                },
                {
                  "Fn::Join": [
                    "",
                    [
                      {
                        "Fn::GetAtt": [
                          "PipelineBucketB967BD35",
                          "Arn"
                        ]
                      },
                      "/",
                      "*"
                    ]
                  ]
                }
              ]
            },
            {
              "Action": "lambda:ListFunctions",
              "Effect": "Allow",
              "Resource": "*"
            },
            {
              "Action": "lambda:InvokeFunction",
              "Effect": "Allow",
              "Resource": {
                "Fn::GetAtt": [
                  "LambdaFun98622869",
                  "Arn"
                ]
              }
            }
          ],
          "Version": "2012-10-17"
        },
        "PolicyName": "PipelineRoleDefaultPolicyC7A05455",
        "Roles": [
          {
            "Ref": "PipelineRoleD68726F7"
          }
        ]
      }
    },
    "PipelineC660917D": {
      "Type": "AWS::CodePipeline::Pipeline",
      "Properties": {
        "ArtifactStore": {
          "Location": {
            "Ref": "PipelineArtifactsBucket22248F97"
          },
          "Type": "S3"
        },
        "RoleArn": {
          "Fn::GetAtt": [
            "PipelineRoleD68726F7",
            "Arn"
          ]
        },
        "Stages": [
          {
            "Actions": [
              {
                "ActionTypeId": {
                  "Category": "Source",
                  "Owner": "AWS",
                  "Provider": "S3",
                  "Version": "1"
                },
                "Configuration": {
                  "S3Bucket": {
                    "Ref": "PipelineBucketB967BD35"
                  },
                  "S3ObjectKey": "key",
                  "PollForSourceChanges": true
                },
                "InputArtifacts": [],
                "Name": "Source",
                "OutputArtifacts": [
                  {
                    "Name": "SourceArtifact"
                  }
                ],
                "RunOrder": 1
              }
            ],
            "Name": "Source"
          },
          {
            "Actions": [
              {
                "ActionTypeId": {
                  "Category": "Invoke",
                  "Owner": "AWS",
                  "Provider": "Lambda",
                  "Version": "1"
                },
                "Configuration": {
                  "FunctionName": {
                    "Ref": "LambdaFun98622869"
                  }
                },
                "InputArtifacts": [],
                "Name": "Lambda",
                "OutputArtifacts": [],
                "RunOrder": 1
              }
            ],
            "Name": "Lambda"
          }
        ]
      },
      "DependsOn": [
        "PipelineRoleD68726F7",
        "PipelineRoleDefaultPolicyC7A05455"
      ]
    },
    "PipelineBucketB967BD35": {
      "Type": "AWS::S3::Bucket",
      "Properties": {
        "VersioningConfiguration": {
          "Status": "Enabled"
        }
      }
    },
    "LambdaFunServiceRoleF0979767": {
      "Type": "AWS::IAM::Role",
      "Properties": {
        "AssumeRolePolicyDocument": {
          "Statement": [
            {
              "Action": "sts:AssumeRole",
              "Effect": "Allow",
              "Principal": {
                "Service": "lambda.amazonaws.com"
              }
            }
          ],
          "Version": "2012-10-17"
        },
        "ManagedPolicyArns": [
          {
            "Fn::Join": [
              "",
              [
                "arn",
                ":",
                {
                  "Ref": "AWS::Partition"
                },
                ":",
                "iam",
                ":",
                "",
                ":",
                "aws",
                ":",
                "policy",
                "/",
                "service-role/AWSLambdaBasicExecutionRole"
              ]
            ]
          }
        ]
      }
    },
    "LambdaFunServiceRoleDefaultPolicy217FED83": {
      "Type": "AWS::IAM::Policy",
      "Properties": {
        "PolicyDocument": {
          "Statement": [
            {
              "Action": [
                "codepipeline:PutJobSuccessResult",
                "codepipeline:PutJobFailureResult"
              ],
              "Effect": "Allow",
              "Resource": "*"
            }
          ],
          "Version": "2012-10-17"
        },
        "PolicyName": "LambdaFunServiceRoleDefaultPolicy217FED83",
        "Roles": [
          {
            "Ref": "LambdaFunServiceRoleF0979767"
          }
        ]
      }
    },
    "LambdaFun98622869": {
      "Type": "AWS::Lambda::Function",
      "Properties": {
        "Code": {
          "ZipFile": "\n        exports.handler = function () {\n            console.log(\"Hello, world!\");\n        };\n    "
        },
        "Handler": "index.handler",
        "Role": {
          "Fn::GetAtt": [
            "LambdaFunServiceRoleF0979767",
            "Arn"
          ]
        },
        "Runtime": "nodejs6.10"
      },
      "DependsOn": [
        "LambdaFunServiceRoleF0979767",
        "LambdaFunServiceRoleDefaultPolicy217FED83"
      ]
    }
  }
}