Skip to content

Commit

Permalink
Rebase with #1122, make reviewable green
Browse files Browse the repository at this point in the history
Signed-off-by: Yury Tsarev <yury@upbound.io>
  • Loading branch information
ytsarev committed Feb 20, 2022
1 parent 6e90be5 commit 240cc0d
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 44 deletions.
90 changes: 54 additions & 36 deletions apis/iam/v1alpha1/zz_types.go

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

15 changes: 8 additions & 7 deletions package/crds/iam.aws.crossplane.io_instanceprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@ spec:
properties:
arn:
description: "The Amazon Resource Name (ARN). ARNs are unique
identifiers for AWS resources. \n For more information
about ARNs, go to Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
in the AWS General Reference."
identifiers for Amazon Web Services resources. \n For
more information about ARNs, go to Amazon Resource Names
(ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
in the Amazon Web Services General Reference."
type: string
assumeRolePolicyDocument:
type: string
Expand All @@ -220,10 +221,10 @@ spec:
properties:
permissionsBoundaryARN:
description: "The Amazon Resource Name (ARN). ARNs are
unique identifiers for AWS resources. \n For more
information about ARNs, go to Amazon Resource Names
(ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
in the AWS General Reference."
unique identifiers for Amazon Web Services resources.
\n For more information about ARNs, go to Amazon Resource
Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
in the Amazon Web Services General Reference."
type: string
permissionsBoundaryType:
type: string
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ import (
"github.com/crossplane/provider-aws/pkg/controller/iam/accesskey"
"github.com/crossplane/provider-aws/pkg/controller/iam/group"
"github.com/crossplane/provider-aws/pkg/controller/iam/grouppolicyattachment"
"github.com/crossplane/provider-aws/pkg/controller/iam/instanceprofile"
"github.com/crossplane/provider-aws/pkg/controller/iam/groupusermembership"
"github.com/crossplane/provider-aws/pkg/controller/iam/instanceprofile"
"github.com/crossplane/provider-aws/pkg/controller/iam/openidconnectprovider"
"github.com/crossplane/provider-aws/pkg/controller/iam/policy"
"github.com/crossplane/provider-aws/pkg/controller/iam/role"
Expand Down
6 changes: 6 additions & 0 deletions pkg/controller/iam/instanceprofile/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ func postCreate(_ context.Context, cr *svcapitypes.InstanceProfile, resp *svcsdk
return managed.ExternalCreation{}, err
}
sess, err := session.NewSession()
if err != nil {
return cre, err
}
svc := iam.New(sess)
input := &iam.AddRoleToInstanceProfileInput{
InstanceProfileName: aws.String(cr.Name),
Expand All @@ -101,6 +104,9 @@ func postCreate(_ context.Context, cr *svcapitypes.InstanceProfile, resp *svcsdk
func preDelete(_ context.Context, cr *svcapitypes.InstanceProfile, obj *svcsdk.DeleteInstanceProfileInput) (bool, error) {
obj.InstanceProfileName = aws.String(meta.GetExternalName(cr))
sess, err := session.NewSession()
if err != nil {
return false, err
}
svc := iam.New(sess)
input := &iam.RemoveRoleFromInstanceProfileInput{
InstanceProfileName: aws.String(cr.Name),
Expand Down

0 comments on commit 240cc0d

Please sign in to comment.