@@ -44,6 +44,10 @@ export class CfnRole extends cdk.CfnResource implements cdk.IInspectable, IRoleR
4444 return ret ;
4545 }
4646
47+ public static arnForRole(resource: IRoleRef): string {
48+ return resource .roleRef .roleArn ;
49+ }
50+
4751 /**
4852 * @cloudformationAttribute RoleArn
4953 */
@@ -189,7 +193,7 @@ export class CfnResource extends cdk.CfnResource implements cdk.IInspectable, IR
189193 properties: props
190194 });
191195
192- this .permissions = ( cdk . isResolvableObject ( props .permissions ) ? props . permissions : ( ! props . permissions ? undefined : props . permissions . forEach (( item : any , i : number , arr : any []) => { arr [ i ] = flattenCfnResourcePermissionProperty ( item ) }), props . permissions )) ;
196+ this .permissions = props .permissions ;
193197 }
194198
195199 public get resourceRef(): ResourceReference {
@@ -227,18 +231,10 @@ export namespace CfnResource {
227231 /**
228232 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-resource-permission.html#cfn-iam-resource-permission-rolearn
229233 */
230- readonly roleArn?: IRoleRef | string;
234+ readonly roleArn?: string;
231235 }
232236}
233237
234- // @ts-ignore TS6133
235- function flattenCfnResourcePermissionProperty(props: cdk.IResolvable | CfnResource.PermissionProperty): cdk.IResolvable | CfnResource.PermissionProperty {
236- if (cdk .isResolvableObject (props )) return props ;
237- return {
238- roleArn: (props .roleArn as IRoleRef )? .roleRef ? .roleArn ?? cdk .ensureStringOrUndefined (props .roleArn , " roleArn" , " iam.IRoleRef | string" )
239- };
240- }
241-
242238/**
243239 * Determine whether the given properties match those of a \` PermissionProperty\`
244240 *
@@ -385,6 +381,10 @@ export class CfnRole extends cdk.CfnResource implements cdk.IInspectable, IRoleR
385381 return ret ;
386382 }
387383
384+ public static arnForRole(resource: IRoleRef): string {
385+ return resource .roleRef .roleArn ;
386+ }
387+
388388 /**
389389 * @cloudformationAttribute RoleArn
390390 */
@@ -515,6 +515,10 @@ export class CfnUser extends cdk.CfnResource implements cdk.IInspectable, IUserR
515515 return ret ;
516516 }
517517
518+ public static arnForUser(resource : IUserRef ): string {
519+ return resource .userRef .userArn ;
520+ }
521+
518522 /**
519523 * @cloudformationAttribute UserArn
520524 */
@@ -792,6 +796,10 @@ export class CfnRole extends cdk.CfnResource implements cdk.IInspectable, IRoleR
792796 return ret ;
793797 }
794798
799+ public static arnForRole(resource: IRoleRef): string {
800+ return resource .roleRef .roleArn ;
801+ }
802+
795803 /**
796804 * @cloudformationAttribute RoleArn
797805 */
@@ -937,7 +945,7 @@ export class CfnTask extends cdk.CfnResource implements cdk.IInspectable, ITaskR
937945 properties: props
938946 });
939947
940- this .executionConfig = ( ! props .executionConfig ? undefined : flattenCfnTaskExecutionConfigProperty ( props . executionConfig )) ;
948+ this .executionConfig = props .executionConfig ;
941949 }
942950
943951 public get taskRef(): TaskReference {
@@ -975,18 +983,10 @@ export namespace CfnTask {
975983 /**
976984 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-task-executionconfig.html#cfn-iam-task-executionconfig-rolearn
977985 */
978- readonly roleArn?: IRoleRef | string;
986+ readonly roleArn?: string;
979987 }
980988}
981989
982- // @ts-ignore TS6133
983- function flattenCfnTaskExecutionConfigProperty(props: CfnTask.ExecutionConfigProperty | cdk.IResolvable): CfnTask.ExecutionConfigProperty | cdk.IResolvable {
984- if (cdk .isResolvableObject (props )) return props ;
985- return {
986- roleArn: (props .roleArn as IRoleRef )? .roleRef ? .roleArn ?? cdk .ensureStringOrUndefined (props .roleArn , " roleArn" , " iam.IRoleRef | string" )
987- };
988- }
989-
990990/**
991991 * Determine whether the given properties match those of a \` ExecutionConfigProperty\`
992992 *
@@ -1132,6 +1132,10 @@ export class CfnRole extends cdk.CfnResource implements cdk.IInspectable, IRoleR
11321132 return ret ;
11331133 }
11341134
1135+ public static arnForRole(resource: IRoleRef): string {
1136+ return resource .roleRef .roleArn ;
1137+ }
1138+
11351139 /**
11361140 * @cloudformationAttribute RoleArn
11371141 */
@@ -1277,7 +1281,7 @@ export class CfnJob extends cdk.CfnResource implements cdk.IInspectable, IJobRef
12771281 properties: props
12781282 });
12791283
1280- this .config = ( ! props .config ? undefined : flattenCfnJobOldConfigProperty ( props . config )) ;
1284+ this .config = props .config ;
12811285 }
12821286
12831287 public get jobRef(): JobReference {
@@ -1315,7 +1319,7 @@ export namespace CfnJob {
13151319 /**
13161320 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-job-config.html#cfn-iam-job-config-rolearn
13171321 */
1318- readonly roleArn?: IRoleRef | string;
1322+ readonly roleArn?: string;
13191323
13201324 /**
13211325 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-job-config.html#cfn-iam-job-config-timeout
@@ -1332,19 +1336,10 @@ export namespace CfnJob {
13321336 /**
13331337 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-job-oldconfig.html#cfn-iam-job-oldconfig-rolearn
13341338 */
1335- readonly roleArn? : IRoleRef | string ;
1339+ readonly roleArn? : string ;
13361340 }
13371341}
13381342
1339- // @ts-ignore TS6133
1340- function flattenCfnJobConfigProperty(props: CfnJob.ConfigProperty | cdk.IResolvable): CfnJob.ConfigProperty | cdk.IResolvable {
1341- if (cdk .isResolvableObject (props )) return props ;
1342- return {
1343- roleArn: (props .roleArn as IRoleRef )? .roleRef ? .roleArn ?? cdk .ensureStringOrUndefined (props .roleArn , " roleArn" , " iam.IRoleRef | string" ),
1344- timeout : props .timeout
1345- };
1346- }
1347-
13481343/**
13491344 * Determine whether the given properties match those of a \` ConfigProperty\`
13501345 *
@@ -1390,14 +1385,6 @@ function CfnJobConfigPropertyFromCloudFormation(properties: any): cfn_parse.From
13901385 return ret ;
13911386}
13921387
1393- // @ts-ignore TS6133
1394- function flattenCfnJobOldConfigProperty(props : cdk .IResolvable | CfnJob .OldConfigProperty ): cdk .IResolvable | CfnJob .OldConfigProperty {
1395- if (cdk .isResolvableObject (props )) return props ;
1396- return {
1397- roleArn: (props .roleArn as IRoleRef )? .roleRef ? .roleArn ?? cdk .ensureStringOrUndefined (props .roleArn , " roleArn" , " iam.IRoleRef | string" )
1398- };
1399- }
1400-
14011388/**
14021389 * Determine whether the given properties match those of a \`OldConfigProperty\`
14031390 *
@@ -1543,6 +1530,10 @@ export class CfnRole extends cdk.CfnResource implements cdk.IInspectable, IRoleR
15431530 return ret ;
15441531 }
15451532
1533+ public static arnForRole(resource: IRoleRef): string {
1534+ return resource .roleRef .roleArn ;
1535+ }
1536+
15461537 /**
15471538 * @cloudformationAttribute RoleArn
15481539 */
0 commit comments