Skip to content

Add ARN-based resource identity to iam #43503

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

Merged
merged 8 commits into from
Jul 24, 2025
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
12 changes: 12 additions & 0 deletions .changelog/43503.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```release-note:enhancement
resource/aws_iam_openid_connect_provider: Add resource identity support
```
```release-note:enhancement
resource/aws_iam_policy: Add resource identity support
```
```release-note:enhancement
resource/aws_iam_saml_provider: Add resource identity support
```
```release-note:enhancement
resource/aws_iam_service_linked_role: Add resource identity support
```
5 changes: 5 additions & 0 deletions .ci/.tflint.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ rule "aws_acm_certificate_lifecycle" {
rule "aws_accessanalyzer_analyzer_invalid_type" {
enabled = false
}

# Avoids errant findings related to directory paths in generated configuration files
rule "aws_iam_saml_provider_invalid_saml_metadata_document" {
enabled = false
}
6 changes: 2 additions & 4 deletions internal/service/iam/openid_connect_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@ import (
// @SDKResource("aws_iam_openid_connect_provider", name="OIDC Provider")
// @Tags(identifierAttribute="arn", resourceType="OIDCProvider")
// @Testing(name="OpenIDConnectProvider")
// @ArnIdentity
// @Testing(preIdentityVersion="v6.4.0")
func resourceOpenIDConnectProvider() *schema.Resource {
return &schema.Resource{
CreateWithoutTimeout: resourceOpenIDConnectProviderCreate,
ReadWithoutTimeout: resourceOpenIDConnectProviderRead,
UpdateWithoutTimeout: resourceOpenIDConnectProviderUpdate,
DeleteWithoutTimeout: resourceOpenIDConnectProviderDelete,

Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},

Schema: map[string]*schema.Schema{
names.AttrARN: {
Type: schema.TypeString,
Expand Down
155 changes: 155 additions & 0 deletions internal/service/iam/openid_connect_provider_identity_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions internal/service/iam/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,15 @@ const (
// @SDKResource("aws_iam_policy", name="Policy")
// @Tags(identifierAttribute="arn", resourceType="Policy")
// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types;types.Policy")
// @ArnIdentity
// @Testing(preIdentityVersion="v6.4.0")
func resourcePolicy() *schema.Resource {
return &schema.Resource{
CreateWithoutTimeout: resourcePolicyCreate,
ReadWithoutTimeout: resourcePolicyRead,
UpdateWithoutTimeout: resourcePolicyUpdate,
DeleteWithoutTimeout: resourcePolicyDelete,

Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},

Schema: map[string]*schema.Schema{
names.AttrARN: {
Type: schema.TypeString,
Expand Down
160 changes: 160 additions & 0 deletions internal/service/iam/policy_identity_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions internal/service/iam/saml_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@ import (
// @SDKResource("aws_iam_saml_provider", name="SAML Provider")
// @Tags(identifierAttribute="arn", resourceType="SAMLProvider")
// @Testing(tagsTest=false)
// @ArnIdentity
// @Testing(preIdentityVersion="v6.4.0")
func resourceSAMLProvider() *schema.Resource {
return &schema.Resource{
CreateWithoutTimeout: resourceSAMLProviderCreate,
ReadWithoutTimeout: resourceSAMLProviderRead,
UpdateWithoutTimeout: resourceSAMLProviderUpdate,
DeleteWithoutTimeout: resourceSAMLProviderDelete,

Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},

Schema: map[string]*schema.Schema{
names.AttrARN: {
Type: schema.TypeString,
Expand Down
Loading
Loading