Skip to content
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

Resource aws_mwaa_environment configuration change of plugins_s3_object_version is not applied #19265

Closed
jaceksztandera opened this issue May 6, 2021 · 2 comments · Fixed by #19266
Labels
bug Addresses a defect in current functionality. service/mwaa Issues and PRs that pertain to the mwaa service.
Milestone

Comments

@jaceksztandera
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.15.2
hashicorp/aws v3.37.0

Affected Resource(s)

  • aws_mwaa_environment

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_mwaa_environment" "mwaa" {
  airflow_configuration_options = {
    "core.default_task_retries" = 16
    "core.parallelism"          = 1
  }

  dag_s3_path                    = var.dag_s3_path
  execution_role_arn             = aws_iam_role.mwaa.arn
  name                           = var.mwaa_name
  requirements_s3_path           = var.requirements_file
  requirements_s3_object_version = data.external.requirements.result.version
  plugins_s3_path                = var.plugins_file
  plugins_s3_object_version      = data.external.plugins.result.version

  environment_class = var.environment_class

  network_configuration {
    security_group_ids = [data.aws_security_group.mwaa.id]
    subnet_ids         = data.aws_subnet_ids.mwaa.ids
  }

  source_bucket_arn = aws_s3_bucket.mwaa.arn

  logging_configuration {
    dag_processing_logs {
      enabled   = true
      log_level = var.dag_processing_logs
    }

    scheduler_logs {
      enabled   = true
      log_level = var.scheduler_logs
    }

    task_logs {
      enabled   = true
      log_level = var.task_logs
    }

    webserver_logs {
      enabled   = true
      log_level = var.webserver_logs
    }

    worker_logs {
      enabled   = true
      log_level = var.worker_logs
    }
  }

}

Debug Output

Non applicable.

Panic Output

Non applicable.

Expected Behavior

After running terraform apply, object version of plugins file should be updated accordingly to the plugins_s3_object_version value.

Actual Behavior

After terraform apply, the resource is not being updated in-place. Terraform reports incorrectly that the change has been applied, Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

module.mwaa.aws_iam_policy.policy: Refreshing state... [id=arn:aws:iam::XXXXXXXXXX:policy/service-role/airflow-dev-policy]
module.mwaa.aws_s3_bucket.mwaa: Refreshing state... [id=airflow-dev]
module.mwaa.aws_iam_role.mwaa: Refreshing state... [id=airflow-dev-role]
module.mwaa.aws_s3_bucket_public_access_block.mwaa: Refreshing state... [id=airflow-dev]
module.mwaa.aws_mwaa_environment.mwaa: Refreshing state... [id=airflow-dev]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.mwaa.aws_mwaa_environment.mwaa will be updated in-place
  ~ resource "aws_mwaa_environment" "mwaa" {
        id                              = "airflow-dev"
        name                            = "airflow-dev"
      ~ plugins_s3_object_version       = "XXX_Pd6ctpBXPp1WZSw2bJx9qjp_GuC." -> "XXX_ftmKwrSXcrCguwspukt_vNVPL2OC"
        tags                            = {}
        # (19 unchanged attributes hidden)


        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.mwaa.aws_mwaa_environment.mwaa: Modifying... [id=airflow-dev]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 10s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 20s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 30s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 40s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 50s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 1m0s elapsed]
...
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 14m0s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 14m10s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 14m20s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 14m30s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 14m40s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Still modifying... [id=airflow-dev, 14m50s elapsed]
module.mwaa.aws_mwaa_environment.mwaa: Modifications complete after 14m56s [id=airflow-dev]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.


❯ terraform -chdir=environment/dev/mwaa apply
module.mwaa.aws_iam_policy.policy: Refreshing state... [id=arn:aws:iam::XXXXXXXXXX:policy/service-role/airflow-dev-policy]
module.mwaa.aws_s3_bucket.mwaa: Refreshing state... [id=airflow-dev]
module.mwaa.aws_iam_role.mwaa: Refreshing state... [id=airflow-dev-role]
module.mwaa.aws_s3_bucket_public_access_block.mwaa: Refreshing state... [id=airflow-dev]
module.mwaa.aws_mwaa_environment.mwaa: Refreshing state... [id=airflow-dev]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.mwaa.aws_mwaa_environment.mwaa will be updated in-place
  ~ resource "aws_mwaa_environment" "mwaa" {
        id                              = "airflow-dev"
        name                            = "airflow-dev"
      ~ plugins_s3_object_version       = "XXX_Pd6ctpBXPp1WZSw2bJx9qjp_GuC." -> "XXX_ftmKwrSXcrCguwspukt_vNVPL2OC"
        tags                            = {}
        # (19 unchanged attributes hidden)


        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@ghost ghost added the service/mwaa Issues and PRs that pertain to the mwaa service. label May 6, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label May 6, 2021
@anGie44 anGie44 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels May 6, 2021
@anGie44 anGie44 added this to the v3.39.0 milestone May 6, 2021
@ghost
Copy link

ghost commented May 7, 2021

This has been released in version 3.39.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@github-actions
Copy link

github-actions bot commented Jun 6, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/mwaa Issues and PRs that pertain to the mwaa service.
Projects
None yet
2 participants