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

feat(InstanceProfile): Add IAM InstanceProfile Managed Resource #1159

Merged
merged 4 commits into from
Mar 8, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PROJECT_REPO := github.com/crossplane/$(PROJECT_NAME)

PLATFORMS ?= linux_amd64 linux_arm64

CODE_GENERATOR_REPO ?= https://github.com/aws-controllers-k8s/code-generator.git
CODE_GENERATOR_COMMIT ?= f8c0f4711a91e50335450521e3c49673d135d56d
GENERATED_SERVICES := $(shell find ./apis -type f -name generator-config.yaml | cut -d/ -f 3 | tr '\n' ' ')

Expand Down Expand Up @@ -124,7 +125,7 @@ run: go.build
# be in its root directory to call "go run" properly.
services: $(GOIMPORTS)
@if [ ! -d "$(WORK_DIR)/code-generator" ]; then \
cd $(WORK_DIR) && git clone "https://github.com/aws-controllers-k8s/code-generator.git"; \
cd $(WORK_DIR) && git clone "$(CODE_GENERATOR_REPO)"; \
fi
@cd $(WORK_DIR)/code-generator && git fetch origin && git checkout $(CODE_GENERATOR_COMMIT)
@for svc in $(SERVICES); do \
Expand Down
2 changes: 2 additions & 0 deletions apis/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import (
elasticloadbalancingv1alpha1 "github.com/crossplane/provider-aws/apis/elasticloadbalancing/v1alpha1"
elbv2v1alpha1 "github.com/crossplane/provider-aws/apis/elbv2/v1alpha1"
gluev1alpha1 "github.com/crossplane/provider-aws/apis/glue/v1alpha1"
iamv1alpha1 "github.com/crossplane/provider-aws/apis/iam/v1alpha1"
iamv1beta1 "github.com/crossplane/provider-aws/apis/iam/v1beta1"
iotv1alpha1 "github.com/crossplane/provider-aws/apis/iot/v1alpha1"
kafkav1alpha1 "github.com/crossplane/provider-aws/apis/kafka/v1alpha1"
Expand Down Expand Up @@ -84,6 +85,7 @@ func init() {
databasev1beta1.SchemeBuilder.AddToScheme,
docdbv1alpha1.AddToScheme,
elasticloadbalancingv1alpha1.SchemeBuilder.AddToScheme,
iamv1alpha1.SchemeBuilder.AddToScheme,
iamv1beta1.SchemeBuilder.AddToScheme,
elasticachev1alpha1.SchemeBuilder.AddToScheme,
elbv2v1alpha1.SchemeBuilder.AddToScheme,
Expand Down
19 changes: 19 additions & 0 deletions apis/iam/generator-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ignore:
resource_names:
- AccessKey
- AccountAlias
- Doc
- Group
- LoginProfile
- OpenIDConnectProvider
- Policy
- PolicyVersion
- Role
- SAMLProvider
- ServiceLinkedRole
- ServiceSpecificCredential
- User
- VirtualMFADevice
field_paths:
- CreateInstanceProfileInput.InstanceProfileName
- DeleteInstanceProfileInput.InstanceProfileName
19 changes: 19 additions & 0 deletions apis/iam/v1alpha1/custom_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package v1alpha1

import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"

// CustomInstanceProfileParameters includes the custom fields of InstanceProfile.
type CustomInstanceProfileParameters struct {
// Role is the ID for the Role to add to Instance Profile.
// +immutable
// +crossplane:generate:reference:type=github.com/crossplane/provider-aws/apis/iam/v1beta1.Role
Role *string `json:"role,omitempty"`

// RoleRef is a reference to an Role
// +optional
RoleRef *xpv1.Reference `json:"roleRef,omitempty"`

// RoleSelector selects references to Role
// +optional
RoleSelector *xpv1.Selector `json:"roleSelector,omitempty"`
}
24 changes: 24 additions & 0 deletions apis/iam/v1alpha1/zz_doc.go

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

209 changes: 209 additions & 0 deletions apis/iam/v1alpha1/zz_enums.go

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