{"id":18789043,"url":"https://github.com/artemmkin/codedeploy-terraform","last_synced_at":"2025-04-13T13:32:19.794Z","repository":{"id":41271415,"uuid":"121722438","full_name":"Artemmkin/codedeploy-terraform","owner":"Artemmkin","description":"CodeDeploy demo using Terraform and Sample application","archived":false,"fork":false,"pushed_at":"2020-03-10T14:42:10.000Z","size":6,"stargazers_count":30,"open_issues_count":1,"forks_count":40,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T05:02:03.575Z","etag":null,"topics":["codedeploy","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Artemmkin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-16T06:48:56.000Z","updated_at":"2025-01-04T08:08:09.000Z","dependencies_parsed_at":"2022-08-10T01:43:26.581Z","dependency_job_id":null,"html_url":"https://github.com/Artemmkin/codedeploy-terraform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Artemmkin%2Fcodedeploy-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Artemmkin%2Fcodedeploy-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Artemmkin%2Fcodedeploy-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Artemmkin%2Fcodedeploy-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Artemmkin","download_url":"https://codeload.github.com/Artemmkin/codedeploy-terraform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248721252,"owners_count":21151070,"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":["codedeploy","terraform"],"created_at":"2024-11-07T21:06:31.205Z","updated_at":"2025-04-13T13:32:16.250Z","avatar_url":"https://github.com/Artemmkin.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"## CodeDeploy with Terraform Demo\n\n1. Generate an SSH key pair:\n\n```bash\n$ ssh-keygen -t rsa -f ~/.ssh/code-deploy-demo -C cd-demo -P \"\"\n```\n\n2. Run terraform:\n\n  ```bash\n  $ terraform init\n  $ terraform apply\n  ```\n  Resources will be created in eu-west-1 region by default. Change `region` var if you want another region. \n\n\n3. From the output get the name of the s3 bucket created. If you get an output like this: \n\n  ```\n  codedeploydemo-734.s3.amazonaws.com\n  ```\n\n  then the name of the created bucket is `codedeploydemo-734`. Save this bucket name, you will upload the sample application revision to that bucket.\n\n4. Change directory into `sample-app`. And run the following command to create application revision and upload it to S3 bucket (make sure to change the name of the bucket [and region if you changed it in terraform]). \n\n  ```\n  $ cd sample-app\n  $ aws --region eu-west-1 deploy push \\\n      --application-name Sample_App \\\n      --s3-location s3://codedeploydemo-734/SampleApp.zip\n  ```\n\n  This command bundles the files from the current directory into a single archive file named SampleApp.zip, uploads the revision to the `codedeploydemo-734` bucket, and registers information with AWS CodeDeploy about the uploaded revision.\n\n5. Create a deployment (make sure to change the name of the bucket [and region if you changed it in terraform]):\n\n  ```\n  $ aws --region eu-west-1 deploy create-deployment \\\n      --application-name Sample_App \\\n      --deployment-config-name CodeDeployDefault.OneAtATime \\\n      --deployment-group-name Sample_DepGroup \\\n      --s3-location bucket=codedeploydemo-734,bundleType=zip,key=SampleApp.zip\n  ```\n  \n6. Access the Sample application by instace's public IP. Get the instance's public IP from terraform output and put it in your browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemmkin%2Fcodedeploy-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartemmkin%2Fcodedeploy-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemmkin%2Fcodedeploy-terraform/lists"}