hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.77k stars 9.12k forks source link

[Bug]: aws_sagemaker_domain ignores API errors #31912

Closed non7top closed 3 weeks ago

non7top commented 1 year ago

Terraform Core Version

v1.3.7

AWS Provider Version

v5.2.0

Affected Resource(s)

Expected Behavior

Terraform should either succeed applying settings or fail with error from upstream API

Actual Behavior

Terraform apply completes without issues, but the settings are not actually applied. Next plan shows them again.

Relevant Error/Panic Output Snippet

The awscli command shows the actual error.

$ aws sagemaker \
>     update-domain \
>     --domain-id d-xxxxxxxxxxxx \
>     --app-security-group-management Service \
>     --domain-settings-for-update "RStudioServerProDomainSettingsForUpdate={DomainExecutionRoleArn=arn:aws:iam::123456789:role/xxxxxxxxxxx,RStudioConnectUrl=https://posit-connect.example.com/connect/,RStudioPackageManagerUrl=https://posit-pm.example.com/cran/latest}"

An error occurred (ValidationException) when calling the UpdateDomain operation: Unable to update Domain [arn:aws:sagemaker:us-east-1:123456789:domain/d-xxxxxxxxxxxx] with InService App. Delete all InService apps in the domain including shared Apps for [domain-shared] User Profile, and try again.

Terraform Configuration Files

resource "aws_sagemaker_domain" "this" {
  domain_name             = local.name
  auth_mode               = "IAM"
  vpc_id                  = data.aws_vpc.xxx.id
  subnet_ids              = data.aws_subnets.xxx.ids
  app_network_access_type = "VpcOnly"

  app_security_group_management = "Service"

  domain_settings {
    security_group_ids = []

    r_studio_server_pro_domain_settings {
      domain_execution_role_arn    = module.rstudio-domain-execution-role.iam_role_arn
      r_studio_connect_url         = "https://posit-connect.example.com/connect/"
      r_studio_package_manager_url = "https://posit-pm.example.com/cran/latest"
    }
  }
}

Steps to Reproduce

  1. Create domain without rstudio settings
  2. Update config with rstudio settings
  3. Terraform applies without error, but the changes are actually not applied.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 3 weeks ago

[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

github-actions[bot] commented 3 weeks ago

This functionality has been released in v5.67.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. Thank you!