Skip to content

Commit a50dfa6

Browse files
authored
Merge pull request #1 from zeroae/f/first-version
Initial version
2 parents 6767354 + ae88803 commit a50dfa6

File tree

10 files changed

+248
-309
lines changed

10 files changed

+248
-309
lines changed

README.md

Lines changed: 68 additions & 61 deletions
Large diffs are not rendered by default.

README.yaml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66

77
# Name of this project
8-
name: terraform-example-module
8+
name: terraform-aws-mobius3
99

1010
# Logo for this project
1111
#logo: docs/logo.png
@@ -15,50 +15,46 @@ license: "APACHE2"
1515

1616
# Copyrights
1717
copyrights:
18-
- name: "Cloud Posse, LLC"
19-
url: "https://cloudposse.com"
18+
- name: "Zero A.E., LLC"
19+
url: "https://zero-ae.com"
2020
year: "2020"
2121

2222
# Canonical GitHub repo
23-
github_repo: cloudposse/terraform-example-module
23+
github_repo: zeroae/terraform-aws-mobius3
2424

2525
# Badges to display
2626
badges:
2727
- name: "Latest Release"
28-
image: "https://img.shields.io/github/release/cloudposse/terraform-example-module.svg"
29-
url: "https://github.com/cloudposse/terraform-example-module/releases/latest"
30-
- name: "Slack Community"
31-
image: "https://slack.cloudposse.com/badge.svg"
32-
url: "https://slack.cloudposse.com"
33-
- name: "Discourse Forum"
34-
image: "https://img.shields.io/discourse/https/ask.sweetops.com/posts.svg"
35-
url: "https://ask.sweetops.com/"
28+
image: "https://img.shields.io/github/release/zeroae/terraform-aws-mobius3.svg"
29+
url: "https://github.com/zeroae/terraform-aws-mobius3/releases/latest"
3630

3731
# List any related terraform modules that this module may be used with or that this module depends on.
3832
related:
33+
- name: "terraform-aws-ecs-container-definition"
34+
description: "Terraform module to generate well-formed JSON documents (container definitions) that are passed to the aws_ecs_task_definition Terraform resource."
35+
url: "https://github.com/cloudposse/terraform-aws-ecs-container-definition.git"
3936
- name: "terraform-null-label"
4037
description: "Terraform module designed to generate consistent names and tags for resources. Use terraform-null-label to implement a strict naming convention."
4138
url: "https://github.com/cloudposse/terraform-null-label"
4239

4340
# List any resources helpful for someone to get started. For example, link to the hashicorp documentation or AWS documentation.
4441
references:
42+
- name: "mobius3"
43+
description: "Continuously and asynchronously sync a local folder to an S3 bucket."
44+
url: "https://github.com/uktrade/mobius3"
4545
- name: "Terraform Standard Module Structure"
4646
description: "HashiCorp's standard module structure is a file and directory layout we recommend for reusable modules distributed in separate repositories."
4747
url: "https://www.terraform.io/docs/modules/index.html#standard-module-structure"
4848
- name: "Terraform Module Requirements"
4949
description: "HashiCorp's guidance on all the requirements for publishing a module. Meeting the requirements for publishing a module is extremely easy."
5050
url: "https://www.terraform.io/docs/registry/modules/publish.html#requirements"
51-
- name: "Terraform `random_integer` Resource"
52-
description: "The resource random_integer generates random values from a given range, described by the min and max attributes of a given resource."
53-
url: "https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer"
5451
- name: "Terraform Version Pinning"
5552
description: "The required_version setting can be used to constrain which versions of the Terraform CLI can be used with your configuration"
5653
url: "https://www.terraform.io/docs/configuration/terraform.html#specifying-a-required-terraform-version"
5754

5855
# Short description of this project
5956
description: |-
60-
This is `terraform-example-module` project provides all the scaffolding for a typical well-built Cloud Posse module. It's a template repository you can
61-
use when creating new repositories.
57+
The `terraform-aws-mobius3` module creates the a container definition that syncs an ECS task volumes to S3.
6258
6359
# Introduction to the project
6460
#introduction: |-
@@ -70,8 +66,11 @@ usage: |-
7066
7167
```hcl
7268
module "example" {
73-
source = "https://github.com/cloudposse/terraform-example-module.git?ref=master"
74-
example = "Hello world!"
69+
source = "https://github.com/zeroae/terraform-aws-mobius3.git?ref=master"
70+
71+
bucket_id = "example-bucket-name"
72+
bucket_region = "us-east-1"
73+
bucket_key_prefix = "rootfs/"
7574
}
7675
```
7776
@@ -91,5 +90,5 @@ include:
9190

9291
# Contributors to this project
9392
contributors:
94-
- name: "Erik Osterman"
95-
github: "osterman"
93+
- name: "Patrick Sodré"
94+
github: "sodre"

context.tf

Lines changed: 0 additions & 167 deletions
This file was deleted.

docs/terraform.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,28 @@
99

1010
## Providers
1111

12-
| Name | Version |
13-
|------|---------|
14-
| random | ~> 2.2 |
12+
No provider.
1513

1614
## Inputs
1715

1816
| Name | Description | Type | Default | Required |
1917
|------|-------------|------|---------|:--------:|
20-
| additional\_tag\_map | Additional tags for appending to tags\_as\_list\_of\_maps. Not added to `tags`. | `map(string)` | `{}` | no |
21-
| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no |
22-
| context | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | <pre>object({<br> enabled = bool<br> namespace = string<br> environment = string<br> stage = string<br> name = string<br> delimiter = string<br> attributes = list(string)<br> tags = map(string)<br> additional_tag_map = map(string)<br> regex_replace_chars = string<br> label_order = list(string)<br> id_length_limit = number<br> })</pre> | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_order": [],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no |
23-
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
24-
| enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
25-
| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
26-
| example | Example variable | `string` | `"hello world"` | no |
27-
| id\_length\_limit | Limit `id` to this many characters.<br>Set to `0` for unlimited length.<br>Set to `null` for default, which is `0`.<br>Does not affect `id_full`. | `number` | `null` | no |
28-
| label\_order | The naming order of the id output and Name tag.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no |
29-
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
30-
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |
31-
| regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
32-
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
33-
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no |
18+
| awscli\_image | The AWSCLI Compatible Image | `string` | `"docker.io/amazon/aws-cli:2.0.52"` | no |
19+
| bucket\_id | Bucket Name (aka ID) | `any` | n/a | yes |
20+
| bucket\_key\_prefix | The key prefix to use for the bucket objects. | `any` | n/a | yes |
21+
| bucket\_region | Bucket Region | `any` | n/a | yes |
22+
| log\_configuration | Log configuration options to send to a custom log driver for the container. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html | `any` | `null` | no |
23+
| mobius3\_image | The Mobius3 Image for S3<->FS synchronization | `string` | `"quay.io/uktrade/mobius3:v0.0.32"` | no |
24+
| user | The user that owns the volume. Can be any of these formats: uid, uid:gid. The default is (0:0). | `string` | `"0:0"` | no |
25+
| volume\_name | The volume name. | `string` | `"data"` | no |
3426

3527
## Outputs
3628

3729
| Name | Description |
3830
|------|-------------|
39-
| example | Example output |
40-
| id | ID of the created example |
41-
| random | Stable random number for this example |
31+
| container\_depends\_on | n/a |
32+
| container\_depends\_on\_list | n/a |
33+
| json\_map\_objects | n/a |
34+
| source\_volume | The volume name to use in container definition mount point |
4235

4336
<!-- markdownlint-restore -->

examples/complete/main.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
module "example" {
2-
source = "../.."
3-
4-
example = var.example
5-
1+
module "mobius3" {
2+
source = "../.."
63
context = module.this.context
4+
5+
bucket_id = "example-bucket-name"
6+
bucket_region = "us-east-1"
7+
bucket_key_prefix = "rootfs/"
78
}

examples/complete/outputs.tf

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
output "id" {
2-
description = "ID of the created example"
3-
value = module.example.id
1+
output "json_map_objects" {
2+
description = "The mobius3 container definitions"
3+
value = module.mobius3.json_map_objects
44
}
55

6-
output "example" {
7-
description = "Output \"example\" from example module"
8-
value = module.example.example
9-
}
10-
11-
output "random" {
12-
description = "Output \"random\" from example module"
13-
value = module.example.random
6+
output "container_depends_on" {
7+
description = "The mobius3 container dependency"
8+
value = module.mobius3.container_depends_on
149
}

examples/complete/variables.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
variable "example" {
2-
type = string
3-
description = "The value which will be passed to the example module"
4-
}

0 commit comments

Comments
 (0)