Skip to content

Commit

Permalink
Remove managed_policy_arns from Movetostatus
Browse files Browse the repository at this point in the history
  • Loading branch information
turkenf committed Aug 29, 2023
1 parent c5e2154 commit d472fe6
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 13 deletions.
22 changes: 22 additions & 0 deletions apis/iam/v1beta1/zz_generated.deepcopy.go

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

15 changes: 11 additions & 4 deletions apis/iam/v1beta1/zz_role_types.go

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

7 changes: 2 additions & 5 deletions config/iam/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ func Configure(p *config.Provider) {
})

p.AddResourceConfigurator("aws_iam_role", func(r *config.Resource) {
// Mutually exclusive with:
// aws_iam_policy_attachment
// aws_iam_role_policy_attachment
// aws_iam_role_policy
config.MoveToStatus(r.TerraformResource, "managed_policy_arns")
r.MetaResource.ArgumentDocs["inline_policy"] = `Configuration block defining an exclusive set of IAM inline policies associated with the IAM role. See below. If no blocks are configured, Crossplane will not manage any inline policies in this resource. Configuring one empty block (i.e., inline_policy {}) will cause Crossplane to remove all inline policies added out of band on apply.`
r.MetaResource.ArgumentDocs["managed_policy_arns"] = `Set of exclusive IAM managed policy ARNs to attach to the IAM role. If this attribute is not configured, Crossplane will ignore policy attachments to this resource. When configured, Crossplane will align the role's managed policy attachments with this set by attaching or detaching managed policies. Configuring an empty set (i.e., managed_policy_arns = []) will cause Crossplane to remove all managed policy attachments.`
})

p.AddResourceConfigurator("aws_iam_instance_profile", func(r *config.Resource) {
Expand Down
44 changes: 40 additions & 4 deletions package/crds/iam.aws.upbound.io_roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ spec:
inlinePolicy:
description: Configuration block defining an exclusive set of
IAM inline policies associated with the IAM role. See below.
Configuring one empty block (i.e.
If no blocks are configured, Crossplane will not manage any
inline policies in this resource. Configuring one empty block
(i.e., inline_policy {}) will cause Crossplane to remove all
inline policies added out of band on apply.
items:
properties:
name:
Expand All @@ -92,6 +95,17 @@ spec:
type: string
type: object
type: array
managedPolicyArns:
description: Set of exclusive IAM managed policy ARNs to attach
to the IAM role. If this attribute is not configured, Crossplane
will ignore policy attachments to this resource. When configured,
Crossplane will align the role's managed policy attachments
with this set by attaching or detaching managed policies. Configuring
an empty set (i.e., managed_policy_arns = []) will cause Crossplane
to remove all managed policy attachments.
items:
type: string
type: array
maxSessionDuration:
description: Maximum session duration (in seconds) that you want
to set for the specified role. If you do not specify a value
Expand Down Expand Up @@ -138,7 +152,10 @@ spec:
inlinePolicy:
description: Configuration block defining an exclusive set of
IAM inline policies associated with the IAM role. See below.
Configuring one empty block (i.e.
If no blocks are configured, Crossplane will not manage any
inline policies in this resource. Configuring one empty block
(i.e., inline_policy {}) will cause Crossplane to remove all
inline policies added out of band on apply.
items:
properties:
name:
Expand All @@ -150,6 +167,17 @@ spec:
type: string
type: object
type: array
managedPolicyArns:
description: Set of exclusive IAM managed policy ARNs to attach
to the IAM role. If this attribute is not configured, Crossplane
will ignore policy attachments to this resource. When configured,
Crossplane will align the role's managed policy attachments
with this set by attaching or detaching managed policies. Configuring
an empty set (i.e., managed_policy_arns = []) will cause Crossplane
to remove all managed policy attachments.
items:
type: string
type: array
maxSessionDuration:
description: Maximum session duration (in seconds) that you want
to set for the specified role. If you do not specify a value
Expand Down Expand Up @@ -399,7 +427,10 @@ spec:
inlinePolicy:
description: Configuration block defining an exclusive set of
IAM inline policies associated with the IAM role. See below.
Configuring one empty block (i.e.
If no blocks are configured, Crossplane will not manage any
inline policies in this resource. Configuring one empty block
(i.e., inline_policy {}) will cause Crossplane to remove all
inline policies added out of band on apply.
items:
properties:
name:
Expand All @@ -413,7 +444,12 @@ spec:
type: array
managedPolicyArns:
description: Set of exclusive IAM managed policy ARNs to attach
to the IAM role. Configuring an empty set (i.e.
to the IAM role. If this attribute is not configured, Crossplane
will ignore policy attachments to this resource. When configured,
Crossplane will align the role's managed policy attachments
with this set by attaching or detaching managed policies. Configuring
an empty set (i.e., managed_policy_arns = []) will cause Crossplane
to remove all managed policy attachments.
items:
type: string
type: array
Expand Down

0 comments on commit d472fe6

Please sign in to comment.