Skip to content

Commit

Permalink
Update module with new settings (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnonino committed Sep 1, 2023
1 parent 0e5d5b5 commit 4e25b4c
Show file tree
Hide file tree
Showing 22 changed files with 386 additions and 88 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ on:
release:
types: [published]

env:
DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: localstack
AWS_SECRET_ACCESS_KEY: localstack

jobs:
check-format:
runs-on: ubuntu-latest
Expand All @@ -28,7 +23,13 @@ jobs:
container: hashicorp/terraform
strategy:
matrix: {
dir: ['examples/test']
dir: [
'examples/basic',
'examples/log-configuration-cw',
'examples/log-configuration-s3',
'examples/setting-container-insights',
'examples/service-connect-defaults'
]
}
steps:
- name: Checkout repository
Expand All @@ -45,15 +46,14 @@ jobs:
container: hashicorp/terraform
strategy:
matrix: {
dir: ['examples/test']
dir: [
'examples/basic',
'examples/log-configuration-cw',
'examples/log-configuration-s3',
'examples/setting-container-insights',
'examples/service-connect-defaults'
]
}
services:
localstack:
image: localstack/localstack
env:
SERVICES: apigateway,cloudformation,cloudwatch,dynamodb,es,firehose,iam,kinesis,lambda,route53,redshift,s3,secretsmanager,ses,sns,sqs,ssm,stepfunctions,sts
ports:
- 4566:4566
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -69,7 +69,13 @@ jobs:
name: Show infracost diff
strategy:
matrix: {
dir: ['examples/test']
dir: [
'examples/basic',
'examples/log-configuration-cw',
'examples/log-configuration-s3',
'examples/setting-container-insights',
'examples/service-connect-defaults'
]
}
steps:
- name: Check out repository
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,windows,terraform,visualstudiocode,sublimetext
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,windows,terraform,visualstudiocode,sublimetext
# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,windows,terraform,sublimetext,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,windows,terraform,sublimetext,visualstudiocode

### Linux ###
*~
Expand Down Expand Up @@ -163,4 +163,4 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/linux,macos,windows,terraform,visualstudiocode,sublimetext
# End of https://www.toptal.com/developers/gitignore/api/linux,macos,windows,terraform,sublimetext,visualstudiocode
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In order to run all checks at any point run the following command:

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.24.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.15.0 |

## Modules

Expand All @@ -57,8 +57,10 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_containerInsights"></a> [containerInsights](#input\_containerInsights) | Enables container insights if true | `bool` | `false` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the cluster (up to 255 letters, numbers, hyphens, and underscores) | `any` | n/a | yes |
| <a name="input_configuration"></a> [configuration](#input\_configuration) | (Optional) The execute command configuration for the cluster. | <pre>object({<br> # The details of the execute command configuration.<br> execute_command_configuration = object({<br> # The AWS Key Management Service key ID to encrypt the data between the local client and the container.<br> kms_key_id = optional(string)<br> # The log configuration for the results of the execute command actions Required when logging is OVERRIDE.<br> log_configuration = object({<br> # Whether or not to enable encryption on the CloudWatch logs. If not specified, encryption will be disabled.<br> cloud_watch_encryption_enabled = optional(bool)<br> # The name of the CloudWatch log group to send logs to.<br> cloud_watch_log_group_name = optional(string)<br> # The name of the S3 bucket to send logs to.<br> s3_bucket_name = optional(string)<br> # Whether or not to enable encryption on the logs sent to S3. If not specified, encryption will be disabled.<br> s3_bucket_encryption_enabled = optional(bool)<br> # An optional folder in the S3 bucket to place logs in.<br> s3_key_prefix = optional(string)<br> })<br> # The log setting to use for redirecting logs for your execute command results. Valid values are NONE, DEFAULT, and OVERRIDE.<br> logging = optional(string)<br> })<br> })</pre> | `null` | no |
| <a name="input_containerInsights"></a> [containerInsights](#input\_containerInsights) | (Optional) Enables container insights if true | `bool` | `false` | no |
| <a name="input_name"></a> [name](#input\_name) | (Required) Name of the cluster (up to 255 letters, numbers, hyphens, and underscores). | `any` | n/a | yes |
| <a name="input_service_connect_defaults"></a> [service\_connect\_defaults](#input\_service\_connect\_defaults) | (Optional) Configures a default Service Connect namespace. | <pre>object({<br> # The ARN of the aws_service_discovery_http_namespace that's used when you create a service and don't specify a Service Connect configuration.<br> namespace = string<br> })</pre> | `null` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Resource tags | `map(string)` | `{}` | no |

## Outputs
Expand Down
25 changes: 25 additions & 0 deletions examples/basic/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
18 changes: 18 additions & 0 deletions examples/basic/mock_provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform {
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4"
}
}
}

provider "aws" {
region = "us-east-1"
skip_credentials_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
access_key = "mock_access_key"
secret_key = "mock_secret_key"
}
25 changes: 25 additions & 0 deletions examples/log-configuration-cw/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions examples/log-configuration-cw/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
resource "aws_kms_key" "example" {
description = "example"
deletion_window_in_days = 7
}

resource "aws_cloudwatch_log_group" "example" {
name = "example"
}

module "cluster" {
source = "../../"
name = "test-cluster"

configuration = {
execute_command_configuration = {
kms_key_id = aws_kms_key.example.arn
logging = "OVERRIDE"

log_configuration = {
cloud_watch_encryption_enabled = true
cloud_watch_log_group_name = aws_cloudwatch_log_group.example.name
}
}
}
}
18 changes: 18 additions & 0 deletions examples/log-configuration-cw/mock_provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform {
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4"
}
}
}

provider "aws" {
region = "us-east-1"
skip_credentials_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
access_key = "mock_access_key"
secret_key = "mock_secret_key"
}
25 changes: 25 additions & 0 deletions examples/log-configuration-s3/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions examples/log-configuration-s3/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
resource "aws_kms_key" "example" {
description = "example"
deletion_window_in_days = 7
}

resource "aws_s3_bucket" "example" {
bucket = "my-tf-test-bucket"
}

module "cluster" {
source = "../../"
name = "test-cluster"

configuration = {
execute_command_configuration = {
kms_key_id = aws_kms_key.example.arn
logging = "OVERRIDE"

log_configuration = {
s3_bucket_name = aws_s3_bucket.example.bucket
s3_bucket_encryption_enabled = true
s3_key_prefix = "test-logs"
}
}
}
}
18 changes: 18 additions & 0 deletions examples/log-configuration-s3/mock_provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform {
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4"
}
}
}

provider "aws" {
region = "us-east-1"
skip_credentials_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
access_key = "mock_access_key"
secret_key = "mock_secret_key"
}
25 changes: 25 additions & 0 deletions examples/service-connect-defaults/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions examples/service-connect-defaults/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resource "aws_service_discovery_http_namespace" "example" {
name = "development"
description = "example"
}

module "cluster" {
source = "../../"
name = "test-cluster"

service_connect_defaults = {
namespace = aws_service_discovery_http_namespace.example.arn
}
}
18 changes: 18 additions & 0 deletions examples/service-connect-defaults/mock_provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform {
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4"
}
}
}

provider "aws" {
region = "us-east-1"
skip_credentials_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
access_key = "mock_access_key"
secret_key = "mock_secret_key"
}
25 changes: 25 additions & 0 deletions examples/setting-container-insights/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/setting-container-insights/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module "cluster" {
source = "../../"
name = "test-cluster"

containerInsights = true
}
18 changes: 18 additions & 0 deletions examples/setting-container-insights/mock_provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
terraform {
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4"
}
}
}

provider "aws" {
region = "us-east-1"
skip_credentials_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
access_key = "mock_access_key"
secret_key = "mock_secret_key"
}
Loading

0 comments on commit 4e25b4c

Please sign in to comment.