GitHub action you can use to register a module within Terraform Cloud
token
- Terraform Cloud API Token with at least "Manage Modules" permissions.organization
- Name of Terraform Cloud organizationnamespace
- Your organization's namespacemodule-name
- Name of moduleprovider-name
Name of primary provider used by module
registry-name
- Name of Registry to push to- Defaults to
private
- Defaults to
registered
-"true"
if this action actually registered the module this run.- This is typically only ever
"true"
once in the lifecycle of a Module.
- This is typically only ever
module
- JSON response from one of:- https://www.terraform.io/cloud-docs/api-docs/private-registry/modules#create-a-module-with-no-vcs-connection
- Returned when module is registered with this action
- https://www.terraform.io/cloud-docs/api-docs/private-registry/modules#get-a-module
- Returned with module was already registered
- https://www.terraform.io/cloud-docs/api-docs/private-registry/modules#create-a-module-with-no-vcs-connection
errors
- Any error seen during execution
name: "Register Module"
# if configured as such, this action will only trigger when a new branch is
# created with a `v` prefix
on:
push:
tags:
- 'v*'
jobs:
register-module:
runs-on: ubuntu-latest
steps:
- uses: dcarbone/[email protected]
with:
token: ${{ secrets.TFCLOUD_API_KEY }}
organization: { your organization }
namespace: { your organization namespace }
module-name: { name of module }
provider-name: { name of primary provider used by module }