Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Artemmkin/codedeploy-terraform
CodeDeploy demo using Terraform and Sample application
https://github.com/Artemmkin/codedeploy-terraform
codedeploy terraform
Last synced: 3 months ago
JSON representation
CodeDeploy demo using Terraform and Sample application
- Host: GitHub
- URL: https://github.com/Artemmkin/codedeploy-terraform
- Owner: Artemmkin
- Created: 2018-02-16T06:48:56.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-03-10T14:42:10.000Z (almost 5 years ago)
- Last Synced: 2024-11-07T21:06:27.552Z (3 months ago)
- Topics: codedeploy, terraform
- Language: HCL
- Homepage:
- Size: 5.86 KB
- Stars: 28
- Watchers: 5
- Forks: 40
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## CodeDeploy with Terraform Demo
1. Generate an SSH key pair:
```bash
$ ssh-keygen -t rsa -f ~/.ssh/code-deploy-demo -C cd-demo -P ""
```2. Run terraform:
```bash
$ terraform init
$ terraform apply
```
Resources will be created in eu-west-1 region by default. Change `region` var if you want another region.3. From the output get the name of the s3 bucket created. If you get an output like this:
```
codedeploydemo-734.s3.amazonaws.com
```then the name of the created bucket is `codedeploydemo-734`. Save this bucket name, you will upload the sample application revision to that bucket.
4. 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]).
```
$ cd sample-app
$ aws --region eu-west-1 deploy push \
--application-name Sample_App \
--s3-location s3://codedeploydemo-734/SampleApp.zip
```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.
5. Create a deployment (make sure to change the name of the bucket [and region if you changed it in terraform]):
```
$ aws --region eu-west-1 deploy create-deployment \
--application-name Sample_App \
--deployment-config-name CodeDeployDefault.OneAtATime \
--deployment-group-name Sample_DepGroup \
--s3-location bucket=codedeploydemo-734,bundleType=zip,key=SampleApp.zip
```
6. Access the Sample application by instace's public IP. Get the instance's public IP from terraform output and put it in your browser.