-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ministryofjustice/dk
Various changes
- Loading branch information
Showing
6 changed files
with
32 additions
and
81 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 |
---|---|---|
|
@@ -2,22 +2,22 @@ | |
|
||
Terraform module that will create an S3 bucket in AWS with relevant user account that will have access to bucket. | ||
|
||
The bucket created will prefix the business unit tag and your team name to the bucket identifier to create the bucket name. This ensures that the bucket created is globally unique and avoids name clashes. | ||
|
||
```bash | ||
bucket name = ${business-unit}-${team_name}-${bucket_identifier} | ||
``` | ||
The bucket created will have a randomised name of the format `cloud-platform-7a5c4a2a7e2134a`. This ensures that the bucket created is globally unique. | ||
|
||
## Usage | ||
|
||
```hcl | ||
module "example_team_s3" { | ||
source = "github.com/ministryofjustice/cloud-platform-terraform-s3-bucket?ref=master" | ||
team_name = "example-repo" | ||
bucket_identifier = "example-bucket" | ||
acl = "public-read" | ||
versioning = true | ||
team_name = "example-repo" | ||
acl = "public-read" | ||
versioning = true | ||
business-unit = "example-bu" | ||
application = "example-app" | ||
is-production = "false" | ||
environment-name = "development" | ||
infrastructure-support = "[email protected]" | ||
} | ||
``` | ||
|
||
|
@@ -26,11 +26,9 @@ module "example_team_s3" { | |
| Name | Description | Type | Default | Required | | ||
|------|-------------|:----:|:-----:|:-----:| | ||
| acl | acl manages access to your bucket | string | `private` | no | | ||
| bucket_identifier | This is the bucket identifier, the bucket name will be this prefixed with your team name | string | - | yes | | ||
| team_name | | string | - | yes | | ||
| versioning | version objects stored within your bucket. | boolean | false | no | | ||
|
||
### Tags | ||
### Tags | ||
|
||
Some of the inputs are tags. All infrastructure resources need to be tagged according to MOJ techincal guidence. The tags are stored as variables that you will need to fill out as part of your module. | ||
|
||
|
@@ -43,6 +41,7 @@ https://ministryofjustice.github.io/technical-guidance/standards/documenting-inf | |
| environment-name | | string | - | yes | | ||
| infrastructure-support | The team responsible for managing the infrastructure. Should be of the form team-email | string | - | yes | | ||
| is-production | | string | `false` | yes | | ||
| team_name | | string | - | yes | | ||
|
||
|
||
## Outputs | ||
|
@@ -52,14 +51,4 @@ https://ministryofjustice.github.io/technical-guidance/standards/documenting-inf | |
| access_key_id | Access key id for s3 account | | ||
| bucket_arn | Arn for s3 bucket created | | ||
| bucket_name | bucket name | | ||
| iam_user_name | user name for s3 service account | | ||
| policy_arn | ARN for the new policy | | ||
| secret_access_key | Secret key for s3 account | | ||
| user_arn | Arn for iam user | | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
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
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
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
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 |
---|---|---|
@@ -1,34 +1,19 @@ | ||
output "policy_arn" { | ||
description = "ARN for the new policy" | ||
value = "${aws_iam_policy.policy.arn}" | ||
} | ||
|
||
output "iam_user_name" { | ||
description = "user name for s3 service account" | ||
value = "${aws_iam_user.s3-account.name}" | ||
} | ||
|
||
output "access_key_id" { | ||
description = "Access key id for s3 account" | ||
value = "${aws_iam_access_key.s3-account-access-key.id}" | ||
value = "${aws_iam_access_key.user.id}" | ||
} | ||
|
||
output "secret_access_key" { | ||
description = "Secret key for s3 account" | ||
value = "${aws_iam_access_key.s3-account-access-key.secret}" | ||
value = "${aws_iam_access_key.user.secret}" | ||
} | ||
|
||
output "bucket_arn" { | ||
description = "Arn for s3 bucket created" | ||
value = "${aws_s3_bucket.s3bucket.arn}" | ||
value = "${aws_s3_bucket.bucket.arn}" | ||
} | ||
|
||
output "bucket_name" { | ||
description = "bucket name" | ||
value = "${aws_s3_bucket.s3bucket.bucket}" | ||
} | ||
|
||
output "user_arn" { | ||
description = "Arn for iam user" | ||
value = "${aws_iam_user.s3-account.arn}" | ||
value = "${aws_s3_bucket.bucket.id}" | ||
} |
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