Skip to content
Open
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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ module "parameter" {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.37 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0.0 |

## Providers

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

## Modules

Expand All @@ -199,6 +199,7 @@ No modules.
| <a name="input_key_id"></a> [key\_id](#input\_key\_id) | KMS key ID or ARN for encrypting a parameter (when type is SecureString) | `string` | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | Name of SSM parameter | `string` | `null` | no |
| <a name="input_overwrite"></a> [overwrite](#input\_overwrite) | Overwrite an existing parameter. If not specified, defaults to false during create operations to avoid overwriting existing resources and then true for all subsequent operations once the resource is managed by Terraform. Only relevant if ignore\_value\_changes is false. | `bool` | `false` | no |
| <a name="input_region"></a> [region](#input\_region) | Region where the resource(s) will be managed. Defaults to the Region set in the provider configuration | `string` | `null` | no |
| <a name="input_secure_type"></a> [secure\_type](#input\_secure\_type) | Whether the type of the value should be considered as secure or not? | `bool` | `false` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to resources | `map(string)` | `{}` | no |
| <a name="input_tier"></a> [tier](#input\_tier) | Parameter tier to assign to the parameter. If not specified, will use the default parameter tier for the region. Valid tiers are Standard, Advanced, and Intelligent-Tiering. Downgrading an Advanced tier parameter to Standard will recreate the resource. | `string` | `null` | no |
Expand Down
6 changes: 4 additions & 2 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,21 @@ Note that this example may create resources which cost money. Run `terraform des
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.37 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0.0 |

## Providers

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

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_disabled"></a> [disabled](#module\_disabled) | ../../ | n/a |
| <a name="module_explicit_region"></a> [explicit\_region](#module\_explicit\_region) | ../../ | n/a |
| <a name="module_explicit_region_ignore_value_changes"></a> [explicit\_region\_ignore\_value\_changes](#module\_explicit\_region\_ignore\_value\_changes) | ../../ | n/a |
| <a name="module_multiple"></a> [multiple](#module\_multiple) | ../../ | n/a |
| <a name="module_multiple_ignore_value_changes"></a> [multiple\_ignore\_value\_changes](#module\_multiple\_ignore\_value\_changes) | ../../ | n/a |
| <a name="module_wrapper"></a> [wrapper](#module\_wrapper) | ../../wrappers | n/a |
Expand Down
29 changes: 26 additions & 3 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ provider "aws" {
}

locals {
name = "ex-${basename(path.cwd)}"
region = "eu-west-1"
name = "ex-${basename(path.cwd)}"
region = "eu-west-1"
explicit_region = "eu-west-2"

tags = {
Name = local.name
Expand Down Expand Up @@ -152,6 +153,28 @@ module "multiple_ignore_value_changes" {
tags = local.tags
}

module "explicit_region" {
source = "../../"

region = local.explicit_region
name = "explicit-region"
value = "test-value"

tags = local.tags
}

module "explicit_region_ignore_value_changes" {
source = "../../"

ignore_value_changes = true

region = local.explicit_region
name = "explicit-region-ignore-value-changes"
value = "test-value"

tags = local.tags
}

##########
# Wrapper
##########
Expand Down Expand Up @@ -193,6 +216,6 @@ data "aws_ami" "amazon_linux" {

filter {
name = "name"
values = ["amzn-ami-hvm-*-x86_64-gp2"]
values = ["amzn2-ami-*"]
Comment on lines -196 to +219
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noting that this was returning nothing w/ the previous query in the configured eu-west-1, so updated.

}
}
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.37"
version = ">= 6.0.0"
}
}
}
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ resource "aws_ssm_parameter" "this" {
name = var.name
type = local.type
description = var.description
region = var.region

value = local.secure_type ? local.value : null
insecure_value = local.list_type || local.string_type ? local.value : null
Expand All @@ -35,6 +36,7 @@ resource "aws_ssm_parameter" "ignore_value" {
name = var.name
type = local.type
description = var.description
region = var.region

value = local.secure_type ? local.value : null
insecure_value = local.list_type || local.string_type ? local.value : null
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ variable "secure_type" {
default = false
}

variable "region" {
description = "Region where the resource(s) will be managed. Defaults to the Region set in the provider configuration"
type = string
default = null
}

################################################################################
# SSM Parameter
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.37"
version = ">= 6.0.0"
}
}
}
1 change: 1 addition & 0 deletions wrappers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module "wrapper" {
key_id = try(each.value.key_id, var.defaults.key_id, null)
name = try(each.value.name, var.defaults.name, null)
overwrite = try(each.value.overwrite, var.defaults.overwrite, false)
region = try(each.value.region, var.defaults.region, null)
secure_type = try(each.value.secure_type, var.defaults.secure_type, false)
tags = try(each.value.tags, var.defaults.tags, {})
tier = try(each.value.tier, var.defaults.tier, null)
Expand Down
2 changes: 1 addition & 1 deletion wrappers/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.37"
version = ">= 6.0.0"
}
}
}