-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: mark outputs as sensitive #118
Conversation
Verified that this change actually resolves my problem (I can now properly feed in information from this module into |
/test all |
@syphernl we're looking into why this validate-codeowners still is failing. We'll circle back once it's figured. |
This Pull Request has been updated, so we're dismissing all reviews.
…ainer-definition into fix/tf14_add_sensitive
…m-aws-ecs-container-definition into fix/tf14_add_sensitive
/test all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@osterman This module had never been converted to context.tf
and does not really need to be, since it does not call any other modules and takes an explicit ID (container_name
). Furthermore, it already has an environment
variable declared.
terraform-aws-ecs-container-definition/variables.tf
Lines 84 to 91 in 9aaf88b
variable "environment" { | |
type = list(object({ | |
name = string | |
value = string | |
})) | |
description = "The environment variables to pass to the container. This is a list of maps. map_environment overrides environment" | |
default = [] | |
} |
I started to convert this module to context.tf
by renaming environment
to containter_environment
, but then I thought since that is a breaking change, maybe we should just leave it as is and not use context.tf
here since it is, in fact, ignored . What do you think? Maybe we could take a dummy context
input just for consistency.
@Nuru I agree: this module should not use |
/test all |
3a65559
to
4cff36c
Compare
4cff36c
to
466ac52
Compare
/test all |
Just encountered this change, what inputs were being given to this module that required the use of sensitive? I'm having trouble understanding why the change was done. This breaks any diff outputs and I'm trying to figure out what was going on that necessitated this change. In every case I can come up with, there shouldn't be any secrets emitted in these outputs. |
@dekimsey -- @syphernl specifically mentioned the terraform-aws-ecs-alb-service-task module, which is I'm assuming where he ran into the issue at. Can you expand on what you mean by it break diff outputs? Keep in mind that you can still get the raw output values that are sensitive by utilizing I suggest bringing this up in Slack or our forum if you want to surface this with a wider audience and make headway on it. |
Thanks @Gowiem, I posted on Slack, but I don't think @syphernl is available there. Well, in essence diffs no longer work since they are being hidden by I'm concerned as I believe this change was the result of secrets being passed in improperly by the OP, but I checked and was unable to find the described issue anywhere. What inputs were being used that tripped the sensitive flag? The terraform-aws-ecs-alb-service-task makes no mention or use of any secrets that I can find. I use this module all over the place without issue. The correct way to pass a secret to a container is via Since the sensitive flag tends to make other things things sensitive, I think we should be very careful of what is marked sensitive. |
I am on Slack, but under a different name. Can't check it now though since it's my work account and I have the day off today.
I'm not a fan of this approach either but it seemed to be the only way to get the states to work again. None of my inputs are marked as sensitive, yet Terraform seems to desire it that the outputs are set as such.
I'm also passing along secrets via the |
Well that's just strange, I wonder if there is a bug there with how its passing the sensitive flag. I know there is an open ticket regarding transformations that talks about this a bit, hashicorp/terraform#27337. |
Calling in @nitrocode as he's the primary maintainer for the module AFAIK. |
It seems like marking all the outputs I'd rather us revert this commit 5d0c6c2 to remove the |
Great! That leaves us with the original problem to figure out. Something in the inputs was causing the sensitive flags to propagate. @syphernl, when you return to work, would you be able willing to check if your implementation was perhaps tripping on hashicorp/terraform#27337? I'm hoping that explains the issue you were experiencing. |
Just hit this and is less than helpful being marked as sensitive being unable to see changes to the
|
* Remove sensitive outputs Revert #118 * Auto Format Co-authored-by: cloudpossebot <[email protected]>
@dekimsey As soon as I include the
@joshmyers @dekimsey Aren't you perhaps not using |
Maybe one way to fix this would be to have both non sensitive and sensitive versions of the outputs. Could you provide a reproducible terraform code of the issue? what terraform version and aws provider version are you running? |
Ah yeah, I think that may work :)
module "demo_container" {
source = "git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=0.49.2"
container_name = "demo-container"
container_image = "nginxdemos/hello:latest"
secrets = [
# App specific
{
name = "APP_KEY",
valueFrom = module.store_write_demo.arn_map[local.demo_app_key_parameter]
}
]
environment = [
{
name = "APP_ENV",
value = "production",
}
]
port_mappings = [
{
containerPort = 80
hostPort = 80
protocol = "tcp"
}
]
log_configuration = {
logDriver = "awslogs"
options = {
"awslogs-region" = var.aws_region
"awslogs-group" = join("", aws_cloudwatch_log_group.our_log_group.*.name)
"awslogs-stream-prefix" = "app"
}
}
healthcheck = {
command = ["CMD-SHELL", "curl -f http://localhost:80/health || exit 1"]
retries = 5
timeout = 5
interval = 30
startPeriod = 30
}
}
We're on Terraform 0.14.7 / AWS Provider 3.29.1 |
what
why
Error: Output refers to sensitive values
when using these outputs to feed into other modules (e.g.terraform-aws-ecs-alb-service-task
)references