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.
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 registryREGISTRY_DOMAIN
: the domain of your CodeArtifact registryAUTH_TOKENS
: a comma separate list of tokens for authenticationSECRET_KEY
: a secret key for signing the download URL's
Since this is using AWS CodeArtifact uploading new modules happens with the aws cli. See the documentation 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;}')
Contributions are welcome. Please open an issue or a PR.