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.76k stars 9.12k forks source link

[Bug]: Unable to reference AppStream image shared from another AWS account using `aws_appstream_image` #39494

Open btuenomso opened 1 day ago

btuenomso commented 1 day ago

Terraform Core Version

1.8.3

AWS Provider Version

5.68.0

Affected Resource(s)

data aws_appstream_image

Expected Behavior

When specifying name, type, and most_recent, the AppStream image shared from another AWS account should be retrieved.

Actual Behavior

An error occurred.

Relevant Error/Panic Output Snippet

Error: reading AWS AppStream 2.0 Image Data Source (<null>): couldn't find resource

  with data.aws_appstream_image.al2[0],
  on appstream.tf line 192, in data "aws_appstream_image" "al2":
 192: data "aws_appstream_image" "al2" {

couldn't find resource

Terraform Configuration Files

data "aws_appstream_image" "al2" {
  count = local.flag ? 1 : 0

  name        = "sample-al2-jp-image"
  type        = "SHARED"
  most_recent = true
}

Steps to Reproduce

  1. Pre-share the AppStream image from another AWS account with the settings Use for Image Builder = True and Use for Fleet = True.
  2. Execute terraform plan.

Debug Output

No response

Panic Output

No response

Important Factoids

Additional Information:

The error did not occur when using name_regex instead of name.

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 1 day ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue