Skip to content

Commit 6c67700

Browse files
authored
Remove terratest and fix aws-vault installation (#554)
1 parent 2282354 commit 6c67700

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

_docs-sources/intro/environment-setup/recommended_tools.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* [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.
99
* [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.
1010
* [Terragrunt](https://terragrunt.gruntwork.io/docs/getting-started/install/) – Terragrunt is our layer on top of Terraform to enable a highly DRY code base.
11-
* [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.
1211
* [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.
1312
* [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.
1413

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

28-
RUN apt-get update && apt-get install -y wget unzip curl git
27+
RUN apt-get update && \
28+
apt-get install -y wget unzip curl git
29+
30+
# Install gruntwork-installer, which is the preferred method for installing Gruntwork binaries and modules
31+
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
32+
33+
# Install fetch
34+
ARG FETCH_VERSION=0.4.5
35+
RUN gruntwork-install --repo "https://github.com/gruntwork-io/fetch" --binary-name "fetch" --tag v${FETCH_VERSION} --no-sudo true
2936

3037
# Packer
3138
ARG PACKER_VERSION=1.8.2
3239
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
33-
3440
# Terraform
3541
ARG TERRAFORM_VERSION=1.2.4
3642
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
3743

3844
# Terragrunt
3945
ARG TERRAGRUNT_VERSION=0.38.4
40-
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
46+
RUN gruntwork-install --repo "https://github.com/gruntwork-io/terragrunt" --binary-name "terragrunt" --tag v${TERRAGRUNT_VERSION} --no-sudo true
4147

4248
# aws-vault
4349
ARG AWS_VAULT_VERSION=6.6.0
44-
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
50+
RUN fetch --repo="https://github.com/99designs/aws-vault" --tag="v6.6.0" --release-asset="aws-vault-linux-amd64" /usr/local/bin/
51+
RUN mv /usr/local/bin/aws-vault-linux-amd64 /usr/local/bin/aws-vault
52+
RUN chmod +x /usr/local/bin/aws-vault
4553

4654
# AWS cli
4755
RUN curl -s https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o aws_cli.zip && unzip aws_cli.zip && ./aws/install
@@ -57,10 +65,6 @@ ARG GOPATH='/root/go'
5765
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
5866
RUN echo 'export PATH=$PATH:/usr/local/go/bin' >> /root/.profile
5967
RUN echo 'export GOPATH=/root/go' >> /root/.profile
60-
61-
# Terratest
62-
ARG TERRATEST_VERSION=0.38.18
63-
RUN GOPATH=/root/go /usr/local/go/bin/go get github.com/gruntwork-io/terratest@v${TERRATEST_VERSION}
6468
```
6569

6670
Build the container:

docs/intro/environment-setup/recommended_tools.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* [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.
99
* [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.
1010
* [Terragrunt](https://terragrunt.gruntwork.io/docs/getting-started/install/) – Terragrunt is our layer on top of Terraform to enable a highly DRY code base.
11-
* [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.
1211
* [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.
1312
* [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.
1413

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

28-
RUN apt-get update && apt-get install -y wget unzip curl git
27+
RUN apt-get update && \
28+
apt-get install -y wget unzip curl git
29+
30+
# Install gruntwork-installer, which is the preferred method for installing Gruntwork binaries and modules
31+
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
32+
33+
# Install fetch
34+
ARG FETCH_VERSION=0.4.5
35+
RUN gruntwork-install --repo "https://github.com/gruntwork-io/fetch" --binary-name "fetch" --tag v${FETCH_VERSION} --no-sudo true
2936

3037
# Packer
3138
ARG PACKER_VERSION=1.8.2
3239
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
33-
3440
# Terraform
3541
ARG TERRAFORM_VERSION=1.2.4
3642
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
3743

3844
# Terragrunt
3945
ARG TERRAGRUNT_VERSION=0.38.4
40-
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
46+
RUN gruntwork-install --repo "https://github.com/gruntwork-io/terragrunt" --binary-name "terragrunt" --tag v${TERRAGRUNT_VERSION} --no-sudo true
4147

4248
# aws-vault
4349
ARG AWS_VAULT_VERSION=6.6.0
44-
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
50+
RUN fetch --repo="https://github.com/99designs/aws-vault" --tag="v6.6.0" --release-asset="aws-vault-linux-amd64" /usr/local/bin/
51+
RUN mv /usr/local/bin/aws-vault-linux-amd64 /usr/local/bin/aws-vault
52+
RUN chmod +x /usr/local/bin/aws-vault
4553

4654
# AWS cli
4755
RUN curl -s https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o aws_cli.zip && unzip aws_cli.zip && ./aws/install
@@ -57,10 +65,6 @@ ARG GOPATH='/root/go'
5765
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
5866
RUN echo 'export PATH=$PATH:/usr/local/go/bin' >> /root/.profile
5967
RUN echo 'export GOPATH=/root/go' >> /root/.profile
60-
61-
# Terratest
62-
ARG TERRATEST_VERSION=0.38.18
63-
RUN GOPATH=/root/go /usr/local/go/bin/go get github.com/gruntwork-io/terratest@v${TERRATEST_VERSION}
6468
```
6569

6670
Build the container:
@@ -88,6 +92,6 @@ docker run -it -v $(pwd):/work gruntwork /bin/bash
8892
<!-- ##DOCS-SOURCER-START
8993
{
9094
"sourcePlugin": "local-copier",
91-
"hash": "ac32b886e244fa5b5de7a62ee27f1018"
95+
"hash": "7f188f772b0e347ce8651e40270ce141"
9296
}
9397
##DOCS-SOURCER-END -->

0 commit comments

Comments
 (0)