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

feat: Mark name arg as optional to match AWS API for aws_ram_resource_share data source #36062

Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
39b240b
feat: Mark name arg as optional to match AWS API for aws_ram_resource…
acwwat Mar 4, 2024
5523c20
Merge branch 'main' into HEAD
ewbankkit Mar 13, 2024
6653ae0
Tweak CHANGELOG entry.
ewbankkit Mar 13, 2024
af04347
Tweak 'testAccResourceShareDataSourceConfig_tagsWithoutName'.
ewbankkit Mar 13, 2024
96179e5
Acceptance test output:
ewbankkit Mar 13, 2024
f052992
ram: Reduce visibility.
ewbankkit Mar 13, 2024
acdbe8c
r/aws_ram_resource_share: Tidy up.
ewbankkit Mar 13, 2024
240bde8
Cosmetics.
ewbankkit Mar 13, 2024
f7b5296
Acceptance test output:
ewbankkit Mar 13, 2024
2e4c9ea
'FindResourceShareTimeout' -> 'resourceSharePropagationTimeout'.
ewbankkit Mar 13, 2024
96c9319
'FindInvitationTimeout' -> 'resourceShareInvitationPropagationTimeout'.
ewbankkit Mar 13, 2024
b13dd48
ram: Add 'consts.go'.
ewbankkit Mar 13, 2024
e8f0f2c
Add 'option.Unwrap'.
ewbankkit Mar 13, 2024
bc75b04
Add 'tfresource.AssertMaybeSinglePtrResult'.
ewbankkit Mar 13, 2024
b14050c
Tweak 'tfresource.RetryGWhen'.
ewbankkit Mar 13, 2024
33bd11a
r/aws_ram_resource_share_accepter: Tidy up.
ewbankkit Mar 13, 2024
e084a82
r/aws_ram_resource_share_accepter: Fix acceptance tests.
ewbankkit Mar 13, 2024
f3cc15f
r/aws_ram_resource_association: Tidy up.
ewbankkit Mar 14, 2024
642077d
r/aws_ram_resource_association: Fix acceptance tests.
ewbankkit Mar 14, 2024
f68d43c
Add 'IsAWSAccountID'.
ewbankkit Mar 14, 2024
df6bb85
Use 'IsAWSAccountID'.
ewbankkit Mar 14, 2024
d99ba73
r/aws_ram_principal_association: Tidy up.
ewbankkit Mar 14, 2024
4085948
Add CHANGELOG entry for #36070.
ewbankkit Mar 14, 2024
1002297
r/aws_ram_principal_association: Additional acceptance tests.
ewbankkit Mar 14, 2024
857044b
Add 'TestAccRAMPrincipalAssociation_duplicate'.
ewbankkit Mar 14, 2024
f743ef8
Acceptance test output:
ewbankkit Mar 14, 2024
5c33065
r/aws_ram_principal_association: Prevent creation of duplicate Terraf…
ewbankkit Mar 14, 2024
47b1a1b
Add 'TestAccRAMResourceAssociation_duplicate'.
ewbankkit Mar 14, 2024
cc36db5
Acceptance test output:
ewbankkit Mar 14, 2024
c1b883d
r/aws_ram_resource_association: Prevent creation of duplicate Terrafo…
ewbankkit Mar 14, 2024
56129a9
Fix semgrep 'ci.aws-in-func-name'.
ewbankkit Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions .changelog/36062.txt
@@ -0,0 +1,19 @@
```release-note:enhancement
data-source/aws_ram_resource_share: `name` is Optional
```

```release-note:enhancement
resource/aws_ram_resource_association: Add plan-time validation of `resource_arn` and `resource_share_arn`
```

```release-note:bug
resource/aws_ram_principal_association: Remove from state on resource Read if `principal` is disassociated outside of Terraform
```

```release-note:bug
resource/aws_ram_principal_association: Prevent creation of duplicate Terraform resources
```

```release-note:bug
resource/aws_ram_resource_association: Prevent creation of duplicate Terraform resources
```
4 changes: 2 additions & 2 deletions internal/framework/validators/aws_account_id.go
Expand Up @@ -6,9 +6,9 @@ package validators
import (
"context"

"github.com/YakDriver/regexache"
"github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
itypes "github.com/hashicorp/terraform-provider-aws/internal/types"
)

// awsAccountIDValidator validates that a string Attribute's value is a valid AWS account ID.
Expand All @@ -31,7 +31,7 @@ func (validator awsAccountIDValidator) ValidateString(ctx context.Context, reque
}

// https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-identifiers.html.
if !regexache.MustCompile(`^\d{12}$`).MatchString(request.ConfigValue.ValueString()) {
if !itypes.IsAWSAccountID(request.ConfigValue.ValueString()) {
response.Diagnostics.Append(validatordiag.InvalidAttributeValueDiagnostic(
request.Path,
validator.Description(ctx),
Expand Down
13 changes: 13 additions & 0 deletions internal/service/ram/consts.go
@@ -0,0 +1,13 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package ram

import (
"time"
)

const (
resourceShareInvitationPropagationTimeout = 2 * time.Minute
resourceSharePropagationTimeout = 1 * time.Minute
)
19 changes: 19 additions & 0 deletions internal/service/ram/exports_test.go
@@ -0,0 +1,19 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package ram

// Exports for use in tests only.
var (
ResourcePrincipalAssociation = resourcePrincipalAssociation
ResourceResourceAssociation = resourceResourceAssociation
ResourceResourceShare = resourceResourceShare
ResourceResourceShareAccepter = resourceResourceShareAccepter
ResourceSharingWithOrganization = resourceSharingWithOrganization

FindPrincipalAssociationByTwoPartKey = findPrincipalAssociationByTwoPartKey
FindResourceAssociationByTwoPartKey = findResourceAssociationByTwoPartKey
FindResourceShareOwnerOtherAccountsByARN = findResourceShareOwnerOtherAccountsByARN
FindResourceShareOwnerSelfByARN = findResourceShareOwnerSelfByARN
FindSharingWithOrganization = findSharingWithOrganization
)
186 changes: 0 additions & 186 deletions internal/service/ram/find.go

This file was deleted.