terraform-aws-modules / terraform-aws-app-runner

Terraform module to create AWS App Runner resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/app-runner/aws
Apache License 2.0
33 stars 19 forks source link

# Ensure access role created is attached even if no values are provided via `var.source_configuration` doesnt work as expected #9

Closed ankithriday closed 6 months ago

ankithriday commented 1 year ago

Description

Passing create_access_iam_role=true and source_configuration doesn't include the authentication_configuration attribute.

source_configuration = local.create_access_iam_role ? merge( var.source_configuration, { authentication_configuration = { access_role_arn = aws_iam_role.access[0].arn } } ) : var.source_configuration

The above evaluation fails this is because merge( var.source_configuration, { authentication_configuration = { access_role_arn = aws_iam_role.access[0].arn } } ) has an authentication_configuration attribute, but the false side var.source_configuration doesn't.

Terraform complains with The true and false result expression must have consistent types. The 'true' value includes object attribute "authentication_configuration", which is absent in the 'false' value

⚠️ Note

Versions

Reproduction Code [Required]

create_access_iam_role=true

source_configuration={ auto_deployment_enabled = false image_repository={ image_configuration = { port = 80 }, image_identifier="some_ecr_repo_in_same_account" image_repository_type="ECR" } }

access_iam_role_policies = { 'ecracccess' = 'pre-existing-policy-arn' }

Steps to reproduce the behavior:

no Yes Passing create_access_iam_role=true and source_configuration doesn't include the authentication_configuration attribute. ## Expected behavior

Actual behavior

Terminal Output Screenshot(s)

Additional context

I think the way above line of code is done, might need to reevaluated

ahummel25 commented 10 months ago

@ankithriday I'm also experiencing this same exact issue. Did you find any solution?

thebigcosinus commented 10 months ago

Hi,

@ahummel25 @ankithriday Did you find a solutuion regarding this issue ?

The true and false result expressions must have consistent types. The 'true' value includes object attribute "authentication_configuration", which is absent in the 'false' value.

vanrijm commented 10 months ago

I am also experiencing this issue. Are there any work arounds?

thebigcosinus commented 10 months ago

@vanrijm I added authentication_configuration = null in the source_configuration

source_configuration = { authentication_configuration = null auto_deployments_enabled = false image_repository = {

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 6 months ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 5 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.