Skip to content

Commit

Permalink
Fixing PR Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elamaran11 committed Jun 27, 2024
1 parent 1b464b2 commit 2a0e505
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions docs/addons/upbound-universal-crossplane.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import * as blueprints from '@aws-quickstart/eks-blueprints';
const app = new cdk.App();

const addOn = new blueprints.addons.UpboundUniversalCrossplaneAddOn({
// This should be modified to what is setup with `masterRole` in blueprint setup. Default is `Admin`
clusterAccessRole: "Admin"
}),
// This should be modified to what is setup with `masterRole` in blueprint setup. Default is `Admin`
clusterAccessRole: blueprints.getResource(context => {
return new iam.Role(context.scope, 'AdminRole', { assumedBy: new iam.AccountRootPrincipal() });
}),
});

const blueprint = blueprints.EksBlueprint.builder()
.version("auto")
Expand Down
8 changes: 4 additions & 4 deletions lib/addons/upbound-universal-crossplane/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Construct } from 'constructs';
import {ClusterInfo, Values} from "../../spi";
import { merge } from "ts-deepmerge";
import {createNamespace, supportsALL} from '../../utils';
import { Policy, PolicyDocument} from 'aws-cdk-lib/aws-iam';
import {IRole, Policy, PolicyDocument} from 'aws-cdk-lib/aws-iam';
import * as cdk from 'aws-cdk-lib';
import {HelmAddOn, HelmAddOnUserProps} from "../helm-addon";

Expand All @@ -21,7 +21,7 @@ export interface UpboundCrossplaneAddOnProps extends HelmAddOnUserProps {
* Default: `Admin`
*
*/
clusterAccessRole?: string;
clusterAccessRole: IRole;
}

const defaultProps = {
Expand All @@ -32,7 +32,7 @@ const defaultProps = {
version: '1.14.5-up.1',
repository: 'https://charts.upbound.io/stable',
values: {},
eksMasterRole: "Admin"
eksMasterRole: `arn:aws:iam::${cluster.stack.account}:role/Admin`

Check failure on line 35 in lib/addons/upbound-universal-crossplane/index.ts

View workflow job for this annotation

GitHub Actions / build (20.10.0)

Cannot find name 'cluster'.
};

@supportsALL
Expand Down Expand Up @@ -68,7 +68,7 @@ export class UpboundCrossplaneAddOn extends HelmAddOn {
{
"Effect": "Allow",
"Action": ["sts:AssumeRole"],
"Resource": `arn:aws:iam::${cluster.stack.account}:role/${this.options.clusterAccessRole}`
"Resource": `${this.options.clusterAccessRole}`
},
{
"Effect": "Allow",
Expand Down

0 comments on commit 2a0e505

Please sign in to comment.