Skip to content

Commit

Permalink
Remove inline_policy from Movetostatus and add example role with inli…
Browse files Browse the repository at this point in the history
…ne_policy
  • Loading branch information
turkenf committed Jun 20, 2023
1 parent 1cfb677 commit b60c10e
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 1 deletion.
17 changes: 17 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.

12 changes: 12 additions & 0 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.

2 changes: 1 addition & 1 deletion config/iam/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func Configure(p *config.Provider) {
// aws_iam_policy_attachment
// aws_iam_role_policy_attachment
// aws_iam_role_policy
config.MoveToStatus(r.TerraformResource, "inline_policy", "managed_policy_arns")
config.MoveToStatus(r.TerraformResource, "managed_policy_arns")
})

p.AddResourceConfigurator("aws_iam_instance_profile", func(r *config.Resource) {
Expand Down
36 changes: 36 additions & 0 deletions examples/iam/role-with-inline-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: iam.aws.upbound.io/v1beta1
kind: Role
metadata:
annotations:
meta.upbound.io/example-id: iam/v1beta1/role
labels:
testing.upbound.io/example-name: role
name: role-with-inline-policy
spec:
forProvider:
assumeRolePolicy: |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "eks.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
inlinePolicy:
- name: "my_inline_policy"
policy: |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Resource": "*",
"Action": "ec2:Describe*"
}
]
}
15 changes: 15 additions & 0 deletions package/crds/iam.aws.upbound.io_roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ spec:
description: Whether to force detaching any policies the role
has before destroying it. Defaults to false.
type: boolean
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.
items:
properties:
name:
description: Friendly name of the role. See IAM Identifiers
for more information.
type: string
policy:
description: Policy document as a JSON formatted string.
type: string
type: object
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

0 comments on commit b60c10e

Please sign in to comment.