Skip to content

Commit 23d8fc4

Browse files
authored
Add InstanceProfile support (#90)
**Issue #, if available:** aws-controllers-k8s/community#1854 **Description of changes:** Adds feature for instance profile support for the iam-controller. **Acknowledgement** By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 5e28d6c commit 23d8fc4

32 files changed

+2776
-32
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2023-09-14T23:25:15Z"
3-
build_hash: 892f29d00a4c4ad21a2fa32919921de18190979d
2+
build_date: "2023-10-04T06:33:03Z"
3+
build_hash: 7445de38211639a12e79992d154adab6e60f01fd
44
go_version: go1.21.0
5-
version: v0.27.1
6-
api_directory_checksum: 26341f700d12dfcd4033cf4203492fa381daa7b0
5+
version: v0.27.1-1-g7445de3
6+
api_directory_checksum: 5f836e773a26000be60b198c9166f83ea86405e1
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: 0dfb99b66da90fef5d3bd6eb512243bf87f6d16d
10+
file_checksum: fe29e906cfb41430ae4df1e2dc17ea4a3fb0365f
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ignore:
33
- AccessKey
44
- AccountAlias
55
#- Group
6-
- InstanceProfile
6+
#- InstanceProfile
77
- LoginProfile
88
#- OpenIDConnectProvider
99
#- Policy
@@ -14,6 +14,8 @@ ignore:
1414
- ServiceSpecificCredential
1515
#- User
1616
- VirtualMFADevice
17+
field_paths:
18+
- CreateInstanceProfileOutput.InstanceProfile.Roles
1719
operations:
1820
GetGroup:
1921
# This is necessary because the GetGroupOutput shape has both a Group and a
@@ -72,6 +74,48 @@ resources:
7274
type: map[string]*string
7375
tags:
7476
ignore: true
77+
InstanceProfile:
78+
renames:
79+
operations:
80+
CreateInstanceProfile:
81+
input_fields:
82+
InstanceProfileName: Name
83+
GetInstanceProfile:
84+
input_fields:
85+
InstanceProfileName: Name
86+
DeleteInstanceProfile:
87+
input_fields:
88+
InstanceProfileName: Name
89+
exceptions:
90+
terminal_codes:
91+
- InvalidInput
92+
fields:
93+
Path:
94+
late_initialize: {}
95+
is_immutable: true
96+
# In order to support attaching a role to the instance profile, custom code
97+
# is used to attach/detach the role to the instance profile object based on
98+
# the name of the role. Note that an instance profile can only contain a
99+
# single IAM role at a given time.
100+
Role:
101+
type: "*string"
102+
references:
103+
resource: Role
104+
path: Spec.Name
105+
hooks:
106+
delta_pre_compare:
107+
code: compareTags(delta, a, b)
108+
sdk_create_post_set_output:
109+
template_path: hooks/instance_profile/sdk_create_post_set_output.go.tpl
110+
sdk_delete_pre_build_request:
111+
template_path: hooks/instance_profile/sdk_delete_pre_build_request.go.tpl
112+
sdk_read_one_post_set_output:
113+
template_path: hooks/instance_profile/sdk_read_one_post_set_output.go.tpl
114+
# There is no `UpdateInstanceProfile` API operation. The only way to update an
115+
# instance profile is to update the properties individually or to recreate
116+
# the profile entirely.
117+
update_operation:
118+
custom_method_name: customUpdateInstanceProfile
75119
Policy:
76120
renames:
77121
operations:

apis/v1alpha1/instance_profile.go

Lines changed: 114 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/v1alpha1/types.go

Lines changed: 10 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)