{"id":18866466,"url":"https://github.com/nordcloud/aws-codepipeline-cfn-provider","last_synced_at":"2025-04-14T14:31:11.519Z","repository":{"id":48039893,"uuid":"114631458","full_name":"nordcloud/aws-codepipeline-cfn-provider","owner":"nordcloud","description":"☁️✨⚙️AWS Codepipeline Lambda to deploy stuff using AWS CloudFormation.","archived":false,"fork":false,"pushed_at":"2021-08-10T11:33:04.000Z","size":35,"stargazers_count":23,"open_issues_count":2,"forks_count":3,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-03-28T03:25:01.926Z","etag":null,"topics":["aws","aws-codepipeline","aws-lambda","cloudformation","deployment"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nordcloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-18T11:08:45.000Z","updated_at":"2021-08-10T11:33:00.000Z","dependencies_parsed_at":"2022-08-12T17:20:29.475Z","dependency_job_id":null,"html_url":"https://github.com/nordcloud/aws-codepipeline-cfn-provider","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Faws-codepipeline-cfn-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Faws-codepipeline-cfn-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Faws-codepipeline-cfn-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nordcloud%2Faws-codepipeline-cfn-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nordcloud","download_url":"https://codeload.github.com/nordcloud/aws-codepipeline-cfn-provider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248897089,"owners_count":21179536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-codepipeline","aws-lambda","cloudformation","deployment"],"created_at":"2024-11-08T05:06:37.358Z","updated_at":"2025-04-14T14:31:11.239Z","avatar_url":"https://github.com/nordcloud.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-codepipeline-cfn-provider\n\n[![Lintly](https://lintly.com/gh/nordcloud/aws-codepipeline-cfn-provider/badge.svg)](https://lintly.com/gh/nordcloud/aws-codepipeline-cfn-provider/)\n\n\nCodePipeline built-in cfn provider has a limitation that a cfn template size can't exceed 51kb. \n\n`aws-codepipeline-cfn-provider` solves this problem by providing an alternative cfn provider implemented as a Lambda. \n\nInstead of passing templates directly, it uploads templates to s3 bucket before creating a stack so it can be used to deploy stacks from templates with size \u003e 51kb.\n\n## Requirements\nLambda requires an s3 bucket used to store cfn templates.\nThe bucket name is set by `PIPELINE_TEMPLATES_BUCKET` environment variable.\n\n## Deployment\n\naws-codepipeline-cfn-provider uses `Pipenv` to manage Python dependencies.\n\n#### Create virtualenv and install dependencies\n```\npipenv --three\npipenv install\n```\n\n\n#### Upload zip to an S3 bucket\nModify bucket name and bucket key in `s3_deploy.sh` script\nRun `s3_deploy.sh` to generate a zip package and upload file to S3 bucket.\n\n#### Lambda\nCreate a Lambda in AWS console using zipped package from s3 bucket.\nLambda handler name should be set to: `pipeline_lambda/pipeline_lambda.handler`\n\n## IAM permissions\naws-codepipeline-cfn-provider requires at least the following permissions:\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Action\": [\n                \"codepipeline:PutJobFailureResult\",\n                \"codepipeline:PutJobSuccessResult\"\n            ],\n            \"Resource\": \"*\",\n            \"Effect\": \"Allow\"\n        },\n        {\n            \"Action\": [\n                \"cloudformation:DescribeStacks\",\n                \"cloudformation:DeleteStack\",\n                \"cloudformation:CreateStack\",\n                \"cloudformation:UpdateStack\",\n                \"cloudformation:DescribeChangeSet\",\n                \"cloudformation:CreateChangeSet\",\n                \"cloudformation:ExecuteChangeSet\",\n                \"cloudformation:SetStackPolicy\",\n                \"cloudformation:DeleteChangeSet\",\n                \"iam:PassRole\"\n            ],\n            \"Resource\": \"*\",\n            \"Effect\": \"Allow\"\n        },\n        {\n            \"Action\": [\n                \"s3:GetObject\",\n                \"s3:PutObject\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::your-pipeline-templates-bucket/*\"\n            ],\n            \"Effect\": \"Allow\"\n        },\n        {\n            \"Action\": [\n                \"s3:GetBucketLocation\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::your-pipeline-templates-bucket\"\n            ],\n            \"Effect\": \"Allow\"\n        }\n    ]\n}\n\n```\n\n## UserParameters\nUser parameters are used to configure lambda and should be passed in a JSON format:\n\n```\n{\n    \"ActionMode\": \"operation_name\", [CREATE_UPDATE, DELETE_ONLY, CHANGE_SET_REPLACE, CHANGE_SET_EXECUTE]\n    \"StackName\": \"stack_name\",\n    \"ChangeSetName\": \"change_set_name\",\n    \"TemplatePath\": \"ArtifactName::TemplateFile\",\n    \"ConfigPath\": \"ArtifactName::ConfigFile\",\n    \"RoleArn\": \"cfn_role_arn\",\n    \"OutputFileName\": \"artifact_output_file_name\" (output.json is default),\n    \"ParameterOverrides\": {\"param\": \"value\"}\n    \"Capabilities\": [\"CAPABILITY_NAMED_IAM\", \"CAPABILITY_IAM\"] list or string\n}\n```\n\n## Lambda environment\n- `PIPELINE_TEMPLATES_BUCKET` - S3 bucket used to upload cfn templates to\n\n## Examples\n\n### Pipeline examples\n#### Create stack\n![pipeline create stack example](https://s3.eu-central-1.amazonaws.com/nordcloud-rnd-github-src/nc_pipeline_1.png)\n\n#### Create and execute change set with manual approvement\n![pipeline change set example](https://s3.eu-central-1.amazonaws.com/nordcloud-rnd-github-src/nc_pipeline_2.png)\n\n### Configuration examples\n#### Delete stack:\n```\n{\n    \"StackName\": \"test_stack\",\n    \"ActionMode\": \"DELETE_ONLY,\n    \"RoleArn\": \"cfn_role_arn\",\n\n}\n```\n\n#### Create or update stack:\n```\n{\n    \"ActionMode\": \"CREATE_UPDATE\",\n    \"StackName\": \"test_stack\",\n    \"RoleArn\": \"cfn_role_arn\",\n    \"TemplatePath\": \"MyApp::template.json\",\n    \"ConfigPath\": \"MyApp::config.json\",\n    \"ParameterOverrides\": {\n        \"param1\": \"value1\",\n        \"param2\": { \"Fn::GetParam\" : [ \"MyApp\", \"config2.json\", \"param2\" ] }\n    }\n}\n```\n\n#### Create change set:\n```\n{\n    \"ActionMode\": \"CHANGE_SET_REPLACE\",\n    \"StackName\": \"test_stack\",\n    \"ChangeSetName\": \"test_change_set\",\n    \"RoleArn\": \"cfn_role_arn\",\n    \"TemplatePath\": \"MyApp::template.json\",\n    \"ConfigPath\": \"MyApp::config.json\",\n    \"ParameterOverrides\": {\n        \"param1\": \"value1\",\n        \"param2\": { \"Fn::GetParam\" : [ \"MyApp\", \"config2.json\", \"param2\" ] }\n    }\n}\n```\n\n#### Execute change set:\n```\n{\n    \"ActionMode\": \"CHANGE_SET_EXECUTE\",\n    \"StackName\": \"test_stack\",\n    \"ChangeSetName\": \"test_change_set\",\n    \"RoleArn\": \"cfn_role_arn\"\n    \"OutputFileName\": \"out.json\"\n}\n```\n\n## LICENCE \n\nApache License 2.0\n\nCopyright Nordcloud OY\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Faws-codepipeline-cfn-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnordcloud%2Faws-codepipeline-cfn-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnordcloud%2Faws-codepipeline-cfn-provider/lists"}