Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README and versions.tf #88

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 42 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,55 @@
# cloud-platform-terraform-ecr-credentials

<a href="https://github.com/ministryofjustice/cloud-platform-terraform-ecr-credentials/releases">
<img src="https://img.shields.io/github/release/ministryofjustice/cloud-platform-terraform-ecr-credentials/all.svg" alt="Releases" />
</a>
[![Releases](https://img.shields.io/github/release/ministryofjustice/cloud-platform-terraform-ecr-credentials/all.svg?style=flat-square)](https://github.com/ministryofjustice/cloud-platform-terraform-ecr-credentials/releases)

This Terraform module will create an AWS ECR repository for use on the Cloud Platform.
This Terraform module will create an [Amazon ECR private repository](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html) for use on the Cloud Platform.

If you're using GitHub as your OIDC provider, it will automatically create the required variables for authentication in your GitHub repository.
If you're using GitHub as your OIDC provider, this module will automatically create the required variables for authentication in your GitHub repository.

If you're using CircleCI as your OIDC provider, it will create a Kubernetes ConfigMap with your authentication variables to use as environment variables in CircleCI.
If you're using CircleCI as your OIDC provider, this module will create a Kubernetes ConfigMap in your namespace with your authentication variables to use as environment variables in CircleCI.

This module only supports authentication with GitHub Actions and CircleCI.

## Usage

```hcl
module "container_repository" {
source = "github.com/ministryofjustice/cloud-platform-terraform-ecr-credentials?ref=version" # use the latest release

# Configuration
team_name = var.team_name # also used to name the repository
repo_name = var.namespace
namespace = var.namespace

# OIDC configuration
oidc_providers = ["github"]

# GitHub configuration
github_repositories = ["example-repository"]
}
```

See the [examples/](examples/) folder for more information.

<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.2.5 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.27.0 |
| <a name="requirement_github"></a> [github](#requirement\_github) | >= 4.14.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0.0 |
| <a name="requirement_github"></a> [github](#requirement\_github) | >= 5.0.0 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.0.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.0.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.27.0 |
| <a name="provider_github"></a> [github](#provider\_github) | >= 4.14.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0.0 |
| <a name="provider_github"></a> [github](#provider\_github) | >= 5.0.0 |
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 2.0.0 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0.0 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.0.0 |

## Modules

Expand Down Expand Up @@ -111,3 +130,14 @@ No modules.
| <a name="output_repo_url"></a> [repo\_url](#output\_repo\_url) | ECR repository URL |
| <a name="output_secret_access_key"></a> [secret\_access\_key](#output\_secret\_access\_key) | Secret for the new credentials |
<!-- END_TF_DOCS -->

## Tags

Some of the inputs for this module are tags. All infrastructure resources must be tagged to meet the MOJ Technical Guidance on [Documenting owners of infrastructure](https://technical-guidance.service.justice.gov.uk/documentation/standards/documenting-infrastructure-owners.html).

You should use your namespace variables to populate these. See the [Usage](#usage) section for more information.

## Reading Material

- [Cloud Platform user guide](https://user-guide.cloud-platform.service.justice.gov.uk/#cloud-platform-user-guide)
- [Amazon ECR private repositories guide](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html)
6 changes: 3 additions & 3 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.27.0"
version = ">= 4.0.0"
}
github = {
source = "integrations/github"
version = ">= 4.14.0"
version = ">= 5.0.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = ">= 2.0.0"
}
random = {
source = "hashicorp/random"
version = ">= 2.0.0"
version = ">= 3.0.0"
}
}
}