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

tests/provider: DB Instance RAM share errors #15767

Closed
YakDriver opened this issue Oct 21, 2020 · 2 comments
Closed

tests/provider: DB Instance RAM share errors #15767

YakDriver opened this issue Oct 21, 2020 · 2 comments
Labels
partition/aws-us-gov Pertains to the aws-us-gov partition. service/ec2 Issues and PRs that pertain to the ec2 service. service/ram Issues and PRs that pertain to the ram service. service/rds Issues and PRs that pertain to the rds service. stale Old or inactive issues managed by automation, if no further action taken these will get closed. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Comments

@YakDriver
Copy link
Member

YakDriver commented Oct 21, 2020

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

Description

These acceptance tests fail on commercial & GovCloud partitions:

TestAccAWSDBInstance_DbSubnetGroupName_RamShared
TestAccAWSDBInstance_ReplicateSourceDb_DbSubnetGroupName_RamShared
TestAccAWSDBInstance_SnapshotIdentifier_DbSubnetGroupName_RamShared

With this error: AWS_ALTERNATE_ACCESS_KEY_ID or AWS_ALTERNATE_PROFILE must be set for acceptance tests.

Fixes thus far:

  1. Add AWS_ALTERNATE_ACCESS_KEY_ID to acceptance testing on GovCloud
  2. Enable Sharing on GovCloud account

Still receiving an error:

    resource_aws_db_instance_test.go:352: Step 1/1 error: Error running apply: 
        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization
<org id> could not be found.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting
to share can only be shared within your AWS Organization. This error may also occur if you have not enabled
sharing with your AWS organization, or that onboarding process is still in progress.

New or Affected Resource(s)

  • aws_db_instance
  • aws_ram_resource_share
  • aws_ram_principal_association
  • aws_ram_resource_association

Terraform Configuration Files

resource "aws_ram_resource_share" "test" {
  provider = "awsalternate"

  name = "yakdriver"
}

resource "aws_ram_principal_association" "test" {
  provider = "awsalternate"

  principal          = data.aws_organizations_organization.test.arn
  resource_share_arn = aws_ram_resource_share.test.arn
}

resource "aws_ram_resource_association" "test" {
  count    = 2
  provider = "awsalternate"

  resource_arn       = aws_subnet.test[count.index].arn
  resource_share_arn = aws_ram_resource_share.test.id
}

resource "aws_db_subnet_group" "test" {
  depends_on = [aws_ram_principal_association.test, aws_ram_resource_association.test]

  name       = "yakdriver"
  subnet_ids = aws_subnet.test[*].id
}

resource "aws_security_group" "test" {
  depends_on = [aws_ram_principal_association.test, aws_ram_resource_association.test]

  name   = "yakdriver"
  vpc_id = aws_vpc.test.id
}

resource "aws_db_instance" "test" {
  allocated_storage      = 5
  db_subnet_group_name   = aws_db_subnet_group.test.name
  engine                 = data.aws_rds_orderable_db_instance.test.engine
  identifier             = "yakdriver"
  instance_class         = data.aws_rds_orderable_db_instance.test.instance_class
  password               = "avoid-plaintext-passwords"
  username               = "tfacctest"
  skip_final_snapshot    = true
  vpc_security_group_ids = [aws_security_group.test.id]
}

Debug Output

    resource_aws_db_instance_test.go:352: Step 1/1 error: Error running apply: 
        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization <orgID> could not be found.

        Error: error associating RAM Resource Share: InvalidParameterException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

--- FAIL: TestAccAWSDBInstance_DbSubnetGroupName_RamShared (22.92s)

References

@YakDriver YakDriver added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 21, 2020
@ghost ghost added service/ec2 Issues and PRs that pertain to the ec2 service. service/ram Issues and PRs that pertain to the ram service. service/rds Issues and PRs that pertain to the rds service. labels Oct 21, 2020
@YakDriver YakDriver added partition/aws-us-gov Pertains to the aws-us-gov partition. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed enhancement Requests to existing resources that expand the functionality or scope. labels Oct 21, 2020
@YakDriver YakDriver changed the title tests/provider: DB Instance RAM share errors (GovCloud) tests/provider: DB Instance RAM share errors Oct 21, 2020
@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Oct 12, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2022
@github-actions
Copy link

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 Dec 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
partition/aws-us-gov Pertains to the aws-us-gov partition. service/ec2 Issues and PRs that pertain to the ec2 service. service/ram Issues and PRs that pertain to the ram service. service/rds Issues and PRs that pertain to the rds service. stale Old or inactive issues managed by automation, if no further action taken these will get closed. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

No branches or pull requests

1 participant