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

Use correct list of forbidden ids #32352

Merged
merged 4 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/32352.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
provider: Correctly handle `forbidden_account_ids`
```
2 changes: 1 addition & 1 deletion internal/conns/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (c *Config) ConfigureProvider(ctx context.Context, client *AWSClient) (*AWS
}

if len(c.ForbiddenAccountIds) > 0 {
for _, forbiddenAccountID := range c.AllowedAccountIds {
for _, forbiddenAccountID := range c.ForbiddenAccountIds {
if accountID == forbiddenAccountID {
return nil, diag.Errorf("AWS account ID not allowed: %s", accountID)
}
Expand Down
4 changes: 0 additions & 4 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func New(ctx context.Context) (*schema.Provider, error) {
Elem: &schema.Schema{Type: schema.TypeString},
Optional: true,
ConflictsWith: []string{"forbidden_account_ids"},
Set: schema.HashString,
},
"assume_role": assumeRoleSchema(),
"assume_role_with_web_identity": assumeRoleWithWebIdentitySchema(),
Expand Down Expand Up @@ -87,7 +86,6 @@ func New(ctx context.Context) (*schema.Provider, error) {
Elem: &schema.Schema{Type: schema.TypeString},
Optional: true,
ConflictsWith: []string{"allowed_account_ids"},
Set: schema.HashString,
},
"http_proxy": {
Type: schema.TypeString,
Expand All @@ -106,14 +104,12 @@ func New(ctx context.Context) (*schema.Provider, error) {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
Description: "Resource tag keys to ignore across all resources.",
},
"key_prefixes": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Set: schema.HashString,
Description: "Resource tag key prefixes to ignore across all resources.",
},
},
Expand Down