Skip to content

Commit 1a7022d

Browse files
committed
Upgraded terraform providers
1 parent 04fd074 commit 1a7022d

12 files changed

Lines changed: 114 additions & 103 deletions

.nullstone/module.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ subplatform: container
1111
type: ""
1212
appCategories: []
1313
is_public: true
14+
tool_name: "terraform"

.terraform.lock.hcl

Lines changed: 77 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 0.5.0 (Sep 22, 2025)
2+
* Upgraded Terraform providers.
3+
14
# 0.4.16 (Feb 27, 2025)
25
* Fixed `topics` usage from `event_sources` in capabilities.
36

app.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ locals {
99
}
1010

1111
locals {
12-
lambda_arn = "arn:aws:lambda:${data.aws_region.this.name}:${data.aws_caller_identity.this.account_id}:function:${local.resource_name}"
13-
invoke_arn = "arn:aws:apigateway:${data.aws_region.this.name}:lambda:path/2015-03-31/functions/${local.lambda_arn}/invocations"
12+
lambda_arn = "arn:aws:lambda:${data.aws_region.this.region}:${data.aws_caller_identity.this.account_id}:function:${local.resource_name}"
13+
invoke_arn = "arn:aws:apigateway:${data.aws_region.this.region}:lambda:path/2015-03-31/functions/${local.lambda_arn}/invocations"
1414
app_metadata = tomap({
1515
// Inject app metadata into capabilities here (e.g. security_group_id, role_name)
1616
function_name = local.resource_name

bootstrap_image.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ data "aws_ecr_authorization_token" "temporary" {
44

55
provider "dockerless" {
66
registry_auth = {
7-
"${data.aws_caller_identity.this.account_id}.dkr.ecr.${data.aws_region.this.name}.amazonaws.com" = {
7+
"${data.aws_caller_identity.this.account_id}.dkr.ecr.${data.aws_region.this.region}.amazonaws.com" = {
88
username = data.aws_ecr_authorization_token.temporary.user_name
99
password = data.aws_ecr_authorization_token.temporary.password
1010
}

capabilities.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
locals {
44
cap_modules = [
55
{
6-
id = 0
6+
name = ""
7+
tfId = ""
78
namespace = ""
89
env_prefix = ""
910
outputs = {}
@@ -50,7 +51,7 @@ locals {
5051
{
5152
logDriver = "awslogs"
5253
options = {
53-
"awslogs-region" = data.aws_region.this.name
54+
"awslogs-region" = data.aws_region.this.region
5455
"awslogs-group" = module.logs.name
5556
"awslogs-stream-prefix" = local.block_name
5657
}

capabilities.tf.tmpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{ range . -}}
22
provider "ns" {
3-
capability_id = {{ .Id }}
4-
alias = "cap_{{ .Id }}"
3+
capability_name = "{{ .Name }}"
4+
alias = "{{ .TfModuleName }}"
55
}
66

77
module "{{ .TfModuleName }}" {
@@ -11,13 +11,12 @@ module "{{ .TfModuleName }}" {
1111
{{- end }}
1212

1313
app_metadata = local.app_metadata
14-
{{ range $key, $value := .Variables -}}
15-
{{ if $value.HasValue -}}
14+
{{ range $key, $value := .Variables -}}{{- if $value.HasValue }}
1615
{{ $key }} = jsondecode({{ $value.Value | to_json_string }})
17-
{{- end }}
18-
{{ end }}
16+
{{- end -}}{{- end }}
17+
1918
providers = {
20-
ns = ns.cap_{{ .Id}}
19+
ns = ns.{{ .TfModuleName }}
2120
}
2221
}
2322
{{ end }}
@@ -37,7 +36,8 @@ locals {
3736
cap_modules = [
3837
{{- range $index, $element := .ExceptNeedsDestroyed }}
3938
{{ if $index }}, {{ end }}{
40-
id = {{ $element.Id }}
39+
name = "{{ $element.Name }}"
40+
tfId = "{{ $element.TfId }}"
4141
namespace = "{{ $element.Namespace }}"
4242
env_prefix = "{{ $element.EnvPrefix }}"
4343
outputs = {{ $element.TfModuleAddr }}
@@ -55,7 +55,7 @@ locals {
5555

5656
cap_secrets = merge([
5757
for mod in local.cap_modules : {
58-
for item in lookup(mod.outputs, "secrets", []) : "${mod.env_prefix}${item.name}" => item.value
58+
for item in lookup(mod.outputs, "secrets", []) : "${mod.env_prefix}${item.name}" => sensitive(item.value)
5959
}
6060
]...)
6161
}

encryption.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ data "aws_iam_policy_document" "encryption_key" {
3636

3737
principals {
3838
type = "Service"
39-
identifiers = ["logs.${data.aws_region.this.name}.amazonaws.com"]
39+
identifiers = ["logs.${data.aws_region.this.region}.amazonaws.com"]
4040
}
4141

4242
condition {
4343
test = "ArnEquals"
4444
variable = "kms:EncryptionContext:aws:logs:arn"
45-
values = ["arn:aws:logs:${data.aws_region.this.name}:${data.aws_caller_identity.this.account_id}:*"]
45+
values = ["arn:aws:logs:${data.aws_region.this.region}:${data.aws_caller_identity.this.account_id}:*"]
4646
}
4747
}
4848

env_vars.tf

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,25 @@ locals {
2828
NULLSTONE_PUBLIC_HOSTS = join(",", local.public_hosts)
2929
NULLSTONE_PRIVATE_HOSTS = join(",", local.private_hosts)
3030
})
31-
32-
input_env_vars = merge(local.standard_env_vars, local.cap_env_vars, var.env_vars)
33-
input_secrets = merge(local.cap_secrets, var.secrets)
31+
32+
input_env_vars = merge(local.standard_env_vars, local.cap_env_vars, var.env_vars)
33+
input_secrets = merge(local.cap_secrets, var.secrets)
34+
input_secret_keys = nonsensitive(concat(keys(local.cap_secrets), keys(var.secrets)))
3435
}
3536

3637
data "ns_env_variables" "this" {
3738
input_env_variables = local.input_env_vars
3839
input_secrets = local.input_secrets
3940
}
4041

42+
// ns_secret_keys.this is used to calculate a set of secrets to add to aws secrets manager
43+
// The resulting "secret_keys" attribute must be known at plan time
44+
// This doesn't need to do a full interpolation because we only care about which inputs need to be added to aws secrets manager
45+
// ns_secret_keys.input_env_variables should contain only var.env_vars since they could contain interpolation that promotes them to sensitive
46+
// We exclude "local.cap_env_vars" because capabilities must use "cap_secrets" to create secrets
4147
data "ns_secret_keys" "this" {
4248
input_env_variables = var.env_vars
43-
input_secret_keys = nonsensitive(keys(local.input_secrets))
49+
input_secret_keys = local.input_secret_keys
4450
}
4551

4652
locals {

outputs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
output "region" {
22
description = "string ||| The region the lambda was created."
3-
value = data.aws_region.this.name
3+
value = data.aws_region.this.region
44
}
55

66
output "deployer" {
@@ -84,11 +84,11 @@ output "image_pusher" {
8484
}
8585

8686
output "private_urls" {
87-
description = "list(string) ||| A list of URLs only accessible inside the network."
8887
value = local.private_urls
88+
description = "list(string) ||| A list of URLs only accessible inside the network"
8989
}
9090

9191
output "public_urls" {
92-
description = "list(string) ||| A list of URLs accessible to the public"
9392
value = local.public_urls
93+
description = "list(string) ||| A list of URLs accessible to the public"
9494
}

0 commit comments

Comments
 (0)