-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4a3eaa
commit 4e9458d
Showing
4 changed files
with
313 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM hashicorp/terraform:1.5.6 as terraform | ||
FROM ubuntu:24.04 | ||
|
||
WORKDIR /app | ||
|
||
COPY main.tf /app/main.tf | ||
COPY entrypoint.sh /app/entrypoint.sh | ||
COPY --from=terraform /bin/terraform /bin/terraform | ||
|
||
RUN mkdir -p $HOME/.terraform.d && chmod +x entrypoint.sh | ||
RUN DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends ca-certificates curl | ||
|
||
ENTRYPOINT ["/app/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
# Ensure the terraform rc directory is setup properly | ||
if ! test -f $HOME/.terraform.d/credentials.tfrc.json; then | ||
echo "No Credentials for TFC found, exiting." | ||
exit 1 | ||
fi | ||
|
||
sed -i -e "s/{replace_me}/$ORG/g" main.tf | ||
|
||
terraform init | ||
terraform apply --auto-approve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
terraform { | ||
cloud { | ||
organization = "{replace_me}" | ||
|
||
workspaces { | ||
name = "SMK" | ||
} | ||
} | ||
} | ||
|
||
resource "null_resource" "nothing" { | ||
triggers = { | ||
always_run = timestamp() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters