https://github.com/labd/tf-ca-proxy
A proxy to use AWS CodeArtifact for hosting Terraform modules
https://github.com/labd/tf-ca-proxy
aws-lambda codeartifact terraform
Last synced: about 1 month ago
JSON representation
A proxy to use AWS CodeArtifact for hosting Terraform modules
- Host: GitHub
- URL: https://github.com/labd/tf-ca-proxy
- Owner: labd
- License: mpl-2.0
- Created: 2023-04-04T14:45:50.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-07T14:27:53.000Z (about 3 years ago)
- Last Synced: 2024-12-31T19:29:55.691Z (over 1 year ago)
- Topics: aws-lambda, codeartifact, terraform
- Language: Go
- Homepage:
- Size: 64.5 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS CodeArtifact proxy for Terraform
This is a relatively simple project which allows you to use AWS CodeArtifact as
registry for Terraform modules acting as a bridge. It exposes an API compatible
with the registry format.
# Installation
An example terraform deployment setup is available in the `deployment/` folder.
There are four environment variables which need to be set:
- `REGISTRY_NAME`: the name of your CodeArtifact registry
- `REGISTRY_DOMAIN`: the domain of your CodeArtifact registry
- `AUTH_TOKENS`: a comma separate list of tokens for authentication
- `SECRET_KEY`: a secret key for signing the download URL's
# Uploading new terraform modules
Since this is using AWS CodeArtifact uploading new modules happens with the aws
cli. See the [documentation](https://docs.aws.amazon.com/codeartifact/latest/ug/publishing-using-generic-packages.html)
fore more info.
Example:
```
aws codeartifact publish-package-version \
--domain your-domain \
--repository your-repository \
--namespace your-department \
--format generic \
--package terraform-aws-vpc \
--package-version 1.2.1 \
--asset-name terraform-aws-vpc-1.2.1.zip \
--asset-content terraform-aws-vpc-1.2.1.zip \
--asset-sha256 $(sha256sum asset.tar.gz | awk '{print $1;}')
```
# Contributing
Contributions are welcome. Please open an issue or a PR.