tungbq / aws-lab-with-terraform

Collection of Terraform code for AWS labs
10 stars 13 forks source link

AWS Code Pipeline with Terraform #271

Closed tungbq closed 10 months ago

tungbq commented 10 months ago

https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-codecommit.html

tungbq commented 10 months ago

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codedeploy_deployment_group

tungbq commented 10 months ago

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/codepipeline

tungbq commented 10 months ago

https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodeDeploy.html

tungbq commented 10 months ago

https://github.com/tungbq/aws-codepipeline-demo

tungbq commented 10 months ago

https://docs.aws.amazon.com/codepipeline/latest/userguide/appendix-github-oauth.html#action-reference-GitHub

tungbq commented 10 months ago

Src OK after granting manually image

tungbq commented 10 months ago

Add connection manually image

tungbq commented 10 months ago

no identity-based policy allows the codedeploy:CreateDeployment action

tungbq commented 10 months ago
              + {
                  + Action   = "codedeploy:*"
                  + Effect   = "Allow"
                  + Resource = "*"
                },
tungbq commented 10 months ago

image

tungbq commented 10 months ago

The deployment can’t start because your deployment configuration requires a minimum of 1 healthy instances, but there are only 1 instances in your deployment group. Adjust your deployment configuration settings to reduce the required number of healthy instances or increase the number of instances in this deployment group, and then try again.

tungbq commented 10 months ago

Permission issue - https://stackoverflow.com/questions/64298865/aws-codepipeline-source-action-has-insufficient-permissions-for-codestar-connec

tungbq commented 10 months ago

Pending too long: image

tungbq commented 10 months ago

CodeDeploy agent was not able to receive the lifecycle event. Check the CodeDeploy agent logs on your host and make sure the agent is running and can connect to the CodeDeploy server.

tungbq commented 10 months ago

https://docs.aws.amazon.com/codedeploy/latest/userguide/codedeploy-agent-operations-install-linux.html

tungbq commented 10 months ago

Check sudo service codedeploy-agent status

tungbq commented 10 months ago

Bug - Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3.9/site-packages/cloudinit/config/cc_scripts_user.py'>) faile Indicates user-data runs failed

tungbq commented 10 months ago

Issue with ec2-userdata script? check

tungbq commented 10 months ago

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts

tungbq commented 10 months ago

https://github.com/hashicorp/terraform/issues/7063

tungbq commented 10 months ago

It works The AWS CodeDeploy agent is running as PID 2441

tungbq commented 10 months ago

Pipeline OK now, cheers!