Skip to content

Commit

Permalink
Remove terratest and fix aws-vault installation (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
zackproser authored Oct 10, 2022
1 parent 2282354 commit 6c67700
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
22 changes: 13 additions & 9 deletions _docs-sources/intro/environment-setup/recommended_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* [Packer](https://www.packer.io/downloads) – Packer lets you build a variety of images, including AWS AMIs and Docker containers. Those images are defined via code for repeatability.
* [Terraform](https://www.terraform.io/downloads) – Terraform's declarative nature describes your infrastructure as code. If you're using Gruntwork's products, you're using Terraform.
* [Terragrunt](https://terragrunt.gruntwork.io/docs/getting-started/install/) – Terragrunt is our layer on top of Terraform to enable a highly DRY code base.
* [Terratest](https://github.com/gruntwork-io/terratest) – If you want to test your infrastructure, Terratest enables you to write those tests for manual testing or integration with a CI/CD pipeline.
* [tfenv](https://github.com/tfutils/tfenv#installation)`tfenv` is a set of bash scripts that provide a workflow for managing and using multiple versions of Terraform. It was inspired by similar tools `rbenv` for Ruby versions and `pyenv` for Python.
* [tgswitch](https://github.com/warrensbox/tgswitch#installation)`tgswitch` is a tool for managing and using multiple versions of Terragrunt. Written in golang, it offers similar features as `tfenv`, including managing the versions to use in a version file.

Expand All @@ -25,23 +24,32 @@ Save following to a `Dockerfile`:
```dockerfile title="Dockerfile"
FROM ubuntu:latest

RUN apt-get update && apt-get install -y wget unzip curl git
RUN apt-get update && \
apt-get install -y wget unzip curl git

# Install gruntwork-installer, which is the preferred method for installing Gruntwork binaries and modules
RUN curl -LsS https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/v0.0.38/bootstrap-gruntwork-installer.sh | bash /dev/stdin --version v0.0.38 --no-sudo true

# Install fetch
ARG FETCH_VERSION=0.4.5
RUN gruntwork-install --repo "https://github.com/gruntwork-io/fetch" --binary-name "fetch" --tag v${FETCH_VERSION} --no-sudo true

# Packer
ARG PACKER_VERSION=1.8.2
RUN wget -q https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip && unzip packer_${PACKER_VERSION}_linux_amd64.zip && mv packer /usr/local/bin

# Terraform
ARG TERRAFORM_VERSION=1.2.4
RUN wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip && mv terraform /usr/local/bin

# Terragrunt
ARG TERRAGRUNT_VERSION=0.38.4
RUN wget -q https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux_amd64 && chmod 0755 terragrunt_linux_amd64 && mv terragrunt_linux_amd64 /usr/local/bin/terragrunt
RUN gruntwork-install --repo "https://github.com/gruntwork-io/terragrunt" --binary-name "terragrunt" --tag v${TERRAGRUNT_VERSION} --no-sudo true

# aws-vault
ARG AWS_VAULT_VERSION=6.6.0
RUN wget -q https://github.com/99designs/aws-vault/releases/download/v${AWS_VAULT_VERSION}/aws-vault-linux-amd64 && chmod 0755 aws-vault-linux-amd64 && mv aws-vault-linux-amd64 /usr/local/bin/aws-vault
RUN fetch --repo="https://github.com/99designs/aws-vault" --tag="v6.6.0" --release-asset="aws-vault-linux-amd64" /usr/local/bin/
RUN mv /usr/local/bin/aws-vault-linux-amd64 /usr/local/bin/aws-vault
RUN chmod +x /usr/local/bin/aws-vault

# AWS cli
RUN curl -s https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o aws_cli.zip && unzip aws_cli.zip && ./aws/install
Expand All @@ -57,10 +65,6 @@ ARG GOPATH='/root/go'
RUN curl -L -s https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz -o go.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go.tar.gz
RUN echo 'export PATH=$PATH:/usr/local/go/bin' >> /root/.profile
RUN echo 'export GOPATH=/root/go' >> /root/.profile

# Terratest
ARG TERRATEST_VERSION=0.38.18
RUN GOPATH=/root/go /usr/local/go/bin/go get github.com/gruntwork-io/terratest@v${TERRATEST_VERSION}
```

Build the container:
Expand Down
24 changes: 14 additions & 10 deletions docs/intro/environment-setup/recommended_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* [Packer](https://www.packer.io/downloads) – Packer lets you build a variety of images, including AWS AMIs and Docker containers. Those images are defined via code for repeatability.
* [Terraform](https://www.terraform.io/downloads) – Terraform's declarative nature describes your infrastructure as code. If you're using Gruntwork's products, you're using Terraform.
* [Terragrunt](https://terragrunt.gruntwork.io/docs/getting-started/install/) – Terragrunt is our layer on top of Terraform to enable a highly DRY code base.
* [Terratest](https://github.com/gruntwork-io/terratest) – If you want to test your infrastructure, Terratest enables you to write those tests for manual testing or integration with a CI/CD pipeline.
* [tfenv](https://github.com/tfutils/tfenv#installation)`tfenv` is a set of bash scripts that provide a workflow for managing and using multiple versions of Terraform. It was inspired by similar tools `rbenv` for Ruby versions and `pyenv` for Python.
* [tgswitch](https://github.com/warrensbox/tgswitch#installation)`tgswitch` is a tool for managing and using multiple versions of Terragrunt. Written in golang, it offers similar features as `tfenv`, including managing the versions to use in a version file.

Expand All @@ -25,23 +24,32 @@ Save following to a `Dockerfile`:
```dockerfile title="Dockerfile"
FROM ubuntu:latest

RUN apt-get update && apt-get install -y wget unzip curl git
RUN apt-get update && \
apt-get install -y wget unzip curl git

# Install gruntwork-installer, which is the preferred method for installing Gruntwork binaries and modules
RUN curl -LsS https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/v0.0.38/bootstrap-gruntwork-installer.sh | bash /dev/stdin --version v0.0.38 --no-sudo true

# Install fetch
ARG FETCH_VERSION=0.4.5
RUN gruntwork-install --repo "https://github.com/gruntwork-io/fetch" --binary-name "fetch" --tag v${FETCH_VERSION} --no-sudo true

# Packer
ARG PACKER_VERSION=1.8.2
RUN wget -q https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip && unzip packer_${PACKER_VERSION}_linux_amd64.zip && mv packer /usr/local/bin

# Terraform
ARG TERRAFORM_VERSION=1.2.4
RUN wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip && mv terraform /usr/local/bin

# Terragrunt
ARG TERRAGRUNT_VERSION=0.38.4
RUN wget -q https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux_amd64 && chmod 0755 terragrunt_linux_amd64 && mv terragrunt_linux_amd64 /usr/local/bin/terragrunt
RUN gruntwork-install --repo "https://github.com/gruntwork-io/terragrunt" --binary-name "terragrunt" --tag v${TERRAGRUNT_VERSION} --no-sudo true

# aws-vault
ARG AWS_VAULT_VERSION=6.6.0
RUN wget -q https://github.com/99designs/aws-vault/releases/download/v${AWS_VAULT_VERSION}/aws-vault-linux-amd64 && chmod 0755 aws-vault-linux-amd64 && mv aws-vault-linux-amd64 /usr/local/bin/aws-vault
RUN fetch --repo="https://github.com/99designs/aws-vault" --tag="v6.6.0" --release-asset="aws-vault-linux-amd64" /usr/local/bin/
RUN mv /usr/local/bin/aws-vault-linux-amd64 /usr/local/bin/aws-vault
RUN chmod +x /usr/local/bin/aws-vault

# AWS cli
RUN curl -s https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o aws_cli.zip && unzip aws_cli.zip && ./aws/install
Expand All @@ -57,10 +65,6 @@ ARG GOPATH='/root/go'
RUN curl -L -s https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz -o go.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go.tar.gz
RUN echo 'export PATH=$PATH:/usr/local/go/bin' >> /root/.profile
RUN echo 'export GOPATH=/root/go' >> /root/.profile

# Terratest
ARG TERRATEST_VERSION=0.38.18
RUN GOPATH=/root/go /usr/local/go/bin/go get github.com/gruntwork-io/terratest@v${TERRATEST_VERSION}
```

Build the container:
Expand Down Expand Up @@ -88,6 +92,6 @@ docker run -it -v $(pwd):/work gruntwork /bin/bash
<!-- ##DOCS-SOURCER-START
{
"sourcePlugin": "local-copier",
"hash": "ac32b886e244fa5b5de7a62ee27f1018"
"hash": "7f188f772b0e347ce8651e40270ce141"
}
##DOCS-SOURCER-END -->

0 comments on commit 6c67700

Please sign in to comment.