@fy-stack/cli 0.0.147-alpha.302 → 0.0.147-alpha.304
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +0 -0
- package/package.json +1 -1
- package/dist/assets/get-cdk-json.d.ts +0 -72
- package/dist/assets/get-cdk-json.d.ts.map +0 -1
- package/dist/assets/get-cdk-json.js +0 -79
- package/dist/assets/get-infra.js.d.ts +0 -9
- package/dist/assets/get-infra.js.d.ts.map +0 -1
- package/dist/assets/get-infra.js.js +0 -38
- package/dist/commands/github-aws-construct.d.ts +0 -12
- package/dist/commands/github-aws-construct.d.ts.map +0 -1
- package/dist/commands/github-aws-construct.js +0 -29
- package/dist/commands/github-aws-stack.d.ts +0 -13
- package/dist/commands/github-aws-stack.d.ts.map +0 -1
- package/dist/commands/github-aws-stack.js +0 -28
package/dist/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
type GetCdkJsonParams = {
|
|
2
|
-
command: string;
|
|
3
|
-
include?: string[];
|
|
4
|
-
exclude?: string[];
|
|
5
|
-
};
|
|
6
|
-
export declare function getCdkJson(params: GetCdkJsonParams): {
|
|
7
|
-
app: string;
|
|
8
|
-
watch: {
|
|
9
|
-
include: string[];
|
|
10
|
-
exclude: string[];
|
|
11
|
-
};
|
|
12
|
-
context: {
|
|
13
|
-
"@aws-cdk/aws-lambda:recognizeLayerVersion": boolean;
|
|
14
|
-
"@aws-cdk/core:checkSecretUsage": boolean;
|
|
15
|
-
"@aws-cdk/core:target-partitions": string[];
|
|
16
|
-
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": boolean;
|
|
17
|
-
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": boolean;
|
|
18
|
-
"@aws-cdk/aws-ecs:arnFormatIncludesClusterName": boolean;
|
|
19
|
-
"@aws-cdk/aws-iam:minimizePolicies": boolean;
|
|
20
|
-
"@aws-cdk/core:validateSnapshotRemovalPolicy": boolean;
|
|
21
|
-
"@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": boolean;
|
|
22
|
-
"@aws-cdk/aws-s3:createDefaultLoggingPolicy": boolean;
|
|
23
|
-
"@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": boolean;
|
|
24
|
-
"@aws-cdk/aws-apigateway:disableCloudWatchRole": boolean;
|
|
25
|
-
"@aws-cdk/core:enablePartitionLiterals": boolean;
|
|
26
|
-
"@aws-cdk/aws-events:eventsTargetQueueSameAccount": boolean;
|
|
27
|
-
"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": boolean;
|
|
28
|
-
"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": boolean;
|
|
29
|
-
"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": boolean;
|
|
30
|
-
"@aws-cdk/aws-route53-patters:useCertificate": boolean;
|
|
31
|
-
"@aws-cdk/customresources:installLatestAwsSdkDefault": boolean;
|
|
32
|
-
"@aws-cdk/aws-rds:databaseProxyUniqueResourceName": boolean;
|
|
33
|
-
"@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": boolean;
|
|
34
|
-
"@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": boolean;
|
|
35
|
-
"@aws-cdk/aws-ec2:launchTemplateDefaultUserData": boolean;
|
|
36
|
-
"@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": boolean;
|
|
37
|
-
"@aws-cdk/aws-redshift:columnId": boolean;
|
|
38
|
-
"@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": boolean;
|
|
39
|
-
"@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": boolean;
|
|
40
|
-
"@aws-cdk/aws-apigateway:requestValidatorUniqueId": boolean;
|
|
41
|
-
"@aws-cdk/aws-kms:aliasNameRef": boolean;
|
|
42
|
-
"@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": boolean;
|
|
43
|
-
"@aws-cdk/core:includePrefixInUniqueNameGeneration": boolean;
|
|
44
|
-
"@aws-cdk/aws-efs:denyAnonymousAccess": boolean;
|
|
45
|
-
"@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": boolean;
|
|
46
|
-
"@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": boolean;
|
|
47
|
-
"@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": boolean;
|
|
48
|
-
"@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": boolean;
|
|
49
|
-
"@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": boolean;
|
|
50
|
-
"@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": boolean;
|
|
51
|
-
"@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": boolean;
|
|
52
|
-
"@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": boolean;
|
|
53
|
-
"@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": boolean;
|
|
54
|
-
"@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": boolean;
|
|
55
|
-
"@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": boolean;
|
|
56
|
-
"@aws-cdk/aws-eks:nodegroupNameAttribute": boolean;
|
|
57
|
-
"@aws-cdk/aws-ec2:ebsDefaultGp3Volume": boolean;
|
|
58
|
-
"@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm": boolean;
|
|
59
|
-
"@aws-cdk/custom-resources:logApiResponseDataPropertyTrueDefault": boolean;
|
|
60
|
-
"@aws-cdk/aws-s3:keepNotificationInImportedBucket": boolean;
|
|
61
|
-
"@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions": boolean;
|
|
62
|
-
"@aws-cdk/aws-dynamodb:resourcePolicyPerReplica": boolean;
|
|
63
|
-
"@aws-cdk/aws-ec2:ec2SumTImeoutEnabled": boolean;
|
|
64
|
-
"@aws-cdk/aws-appsync:appSyncGraphQLAPIScopeLambdaPermission": boolean;
|
|
65
|
-
"@aws-cdk/aws-rds:setCorrectValueForDatabaseInstanceReadReplicaInstanceResourceId": boolean;
|
|
66
|
-
"@aws-cdk/core:cfnIncludeRejectComplexResourceUpdateCreatePolicyIntrinsics": boolean;
|
|
67
|
-
"@aws-cdk/aws-lambda-nodejs:sdkV3ExcludeSmithyPackages": boolean;
|
|
68
|
-
"@aws-cdk/aws-stepfunctions-tasks:fixRunEcsTaskPolicy": boolean;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
export {};
|
|
72
|
-
//# sourceMappingURL=get-cdk-json.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-cdk-json.d.ts","sourceRoot":"","sources":["../../src/assets/get-cdk-json.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAA;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4ElD"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCdkJson = getCdkJson;
|
|
4
|
-
function getCdkJson(params) {
|
|
5
|
-
return {
|
|
6
|
-
"app": params.command,
|
|
7
|
-
"watch": {
|
|
8
|
-
"include": params.include ?? ["**"],
|
|
9
|
-
"exclude": params.exclude ?? [
|
|
10
|
-
"README.md",
|
|
11
|
-
"cdk*.json",
|
|
12
|
-
"package*.json",
|
|
13
|
-
"yarn.lock",
|
|
14
|
-
"node_modules",
|
|
15
|
-
]
|
|
16
|
-
},
|
|
17
|
-
"context": {
|
|
18
|
-
"@aws-cdk/aws-lambda:recognizeLayerVersion": true,
|
|
19
|
-
"@aws-cdk/core:checkSecretUsage": true,
|
|
20
|
-
"@aws-cdk/core:target-partitions": [
|
|
21
|
-
"aws",
|
|
22
|
-
"aws-cn"
|
|
23
|
-
],
|
|
24
|
-
"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
|
|
25
|
-
"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
|
|
26
|
-
"@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
|
|
27
|
-
"@aws-cdk/aws-iam:minimizePolicies": true,
|
|
28
|
-
"@aws-cdk/core:validateSnapshotRemovalPolicy": true,
|
|
29
|
-
"@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
|
|
30
|
-
"@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
|
|
31
|
-
"@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
|
|
32
|
-
"@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
|
|
33
|
-
"@aws-cdk/core:enablePartitionLiterals": true,
|
|
34
|
-
"@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
|
|
35
|
-
"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
|
|
36
|
-
"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
|
|
37
|
-
"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
|
|
38
|
-
"@aws-cdk/aws-route53-patters:useCertificate": true,
|
|
39
|
-
"@aws-cdk/customresources:installLatestAwsSdkDefault": false,
|
|
40
|
-
"@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
|
|
41
|
-
"@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
|
|
42
|
-
"@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
|
|
43
|
-
"@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
|
|
44
|
-
"@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
|
|
45
|
-
"@aws-cdk/aws-redshift:columnId": true,
|
|
46
|
-
"@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
|
|
47
|
-
"@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
|
|
48
|
-
"@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
|
|
49
|
-
"@aws-cdk/aws-kms:aliasNameRef": true,
|
|
50
|
-
"@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
|
|
51
|
-
"@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
|
|
52
|
-
"@aws-cdk/aws-efs:denyAnonymousAccess": true,
|
|
53
|
-
"@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
|
|
54
|
-
"@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
|
|
55
|
-
"@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
|
|
56
|
-
"@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
|
|
57
|
-
"@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
|
|
58
|
-
"@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
|
|
59
|
-
"@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
|
|
60
|
-
"@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true,
|
|
61
|
-
"@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true,
|
|
62
|
-
"@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2": true,
|
|
63
|
-
"@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope": true,
|
|
64
|
-
"@aws-cdk/aws-eks:nodegroupNameAttribute": true,
|
|
65
|
-
"@aws-cdk/aws-ec2:ebsDefaultGp3Volume": true,
|
|
66
|
-
"@aws-cdk/aws-ecs:removeDefaultDeploymentAlarm": true,
|
|
67
|
-
"@aws-cdk/custom-resources:logApiResponseDataPropertyTrueDefault": false,
|
|
68
|
-
"@aws-cdk/aws-s3:keepNotificationInImportedBucket": false,
|
|
69
|
-
"@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions": true,
|
|
70
|
-
"@aws-cdk/aws-dynamodb:resourcePolicyPerReplica": true,
|
|
71
|
-
"@aws-cdk/aws-ec2:ec2SumTImeoutEnabled": true,
|
|
72
|
-
"@aws-cdk/aws-appsync:appSyncGraphQLAPIScopeLambdaPermission": true,
|
|
73
|
-
"@aws-cdk/aws-rds:setCorrectValueForDatabaseInstanceReadReplicaInstanceResourceId": true,
|
|
74
|
-
"@aws-cdk/core:cfnIncludeRejectComplexResourceUpdateCreatePolicyIntrinsics": true,
|
|
75
|
-
"@aws-cdk/aws-lambda-nodejs:sdkV3ExcludeSmithyPackages": true,
|
|
76
|
-
"@aws-cdk/aws-stepfunctions-tasks:fixRunEcsTaskPolicy": true
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-infra.js.d.ts","sourceRoot":"","sources":["../../src/assets/get-infra.js.ts"],"names":[],"mappings":"AAEA,KAAK,kBAAkB,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,kBAAkB;;;EAoClD"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInfra = getInfra;
|
|
4
|
-
const get_cdk_json_1 = require("./get-cdk-json");
|
|
5
|
-
function getInfra(params) {
|
|
6
|
-
const infraFile = `#!/usr/bin/env node
|
|
7
|
-
const cdk = require("aws-cdk-lib");
|
|
8
|
-
const { FullStackConstruct, AppType } = require("@fy-stack/fullstack-construct");
|
|
9
|
-
|
|
10
|
-
const env = {
|
|
11
|
-
account: process.env.CDK_DEFAULT_ACCOUNT,
|
|
12
|
-
region: process.env.CDK_DEFAULT_REGION,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
class AppStack extends cdk.Stack {
|
|
16
|
-
constructor(scope, id, props) {
|
|
17
|
-
super(scope, id, props);
|
|
18
|
-
|
|
19
|
-
const app = new FullStackConstruct(this, "App", {
|
|
20
|
-
storage: { retainOnDelete: false, },
|
|
21
|
-
apps: {},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
cdk.Tags.of(this).add("App", "${params.app}");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const app = new cdk.App();
|
|
29
|
-
new AppStack(
|
|
30
|
-
app,
|
|
31
|
-
"app",
|
|
32
|
-
{ env, stackName: "<generate-stack-name>" }
|
|
33
|
-
);`;
|
|
34
|
-
const cdkJsonFile = JSON.stringify((0, get_cdk_json_1.getCdkJson)({
|
|
35
|
-
command: 'node infra.js',
|
|
36
|
-
}), null, 2);
|
|
37
|
-
return { infraFile, cdkJsonFile };
|
|
38
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Construct } from 'constructs';
|
|
2
|
-
type GithubAwsConstructProps = {
|
|
3
|
-
/**
|
|
4
|
-
* Github repo name e.t.c. GitHubOrg/GitHubRepo:ref:refs/heads/GitHubBranch
|
|
5
|
-
* */
|
|
6
|
-
repo: string;
|
|
7
|
-
};
|
|
8
|
-
export declare class GithubAwsConstruct extends Construct {
|
|
9
|
-
constructor(scope: Construct, id: string, props: GithubAwsConstructProps);
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=github-aws-construct.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"github-aws-construct.d.ts","sourceRoot":"","sources":["../../src/commands/github-aws-construct.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,KAAK,uBAAuB,GAAG;IAC7B;;SAEK;IACL,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,qBAAa,kBAAmB,SAAQ,SAAS;gBAEnC,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB;CA0BzE"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GithubAwsConstruct = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const iam = tslib_1.__importStar(require("aws-cdk-lib/aws-iam"));
|
|
6
|
-
const constructs_1 = require("constructs");
|
|
7
|
-
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
8
|
-
class GithubAwsConstruct extends constructs_1.Construct {
|
|
9
|
-
constructor(scope, id, props) {
|
|
10
|
-
super(scope, id);
|
|
11
|
-
const provider = new iam.OpenIdConnectProvider(this, 'GithubProvider', {
|
|
12
|
-
url: 'https://token.actions.githubusercontent.com',
|
|
13
|
-
clientIds: ['sts.amazonaws.com']
|
|
14
|
-
});
|
|
15
|
-
const role = new iam.Role(this, 'GithubRole', {
|
|
16
|
-
assumedBy: new iam.FederatedPrincipal(provider.openIdConnectProviderArn, {
|
|
17
|
-
StringEquals: {
|
|
18
|
-
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
|
|
19
|
-
"token.actions.githubusercontent.com:sub": `repo:${props.repo}`
|
|
20
|
-
}
|
|
21
|
-
}, "sts:AssumeRoleWithWebIdentity"),
|
|
22
|
-
});
|
|
23
|
-
new aws_cdk_lib_1.CfnOutput(this, 'RoleArn', {
|
|
24
|
-
key: 'roleArn',
|
|
25
|
-
value: role.roleArn
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.GithubAwsConstruct = GithubAwsConstruct;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Construct } from 'constructs';
|
|
2
|
-
import { Stack, StackProps } from 'aws-cdk-lib';
|
|
3
|
-
type GithubAwsConstructProps = StackProps & {
|
|
4
|
-
/**
|
|
5
|
-
* Github repo name e.t.c. GitHubOrg/GitHubRepo:ref:refs/heads/GitHubBranch
|
|
6
|
-
* */
|
|
7
|
-
repo: string;
|
|
8
|
-
};
|
|
9
|
-
export declare class GithubAwsStack extends Stack {
|
|
10
|
-
constructor(scope: Construct, id: string, props: GithubAwsConstructProps);
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=github-aws-stack.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"github-aws-stack.d.ts","sourceRoot":"","sources":["../../src/commands/github-aws-stack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAa,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE3D,KAAK,uBAAuB,GAAG,UAAU,GAAG;IAC1C;;SAEK;IACL,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,qBAAa,cAAe,SAAQ,KAAK;gBAE3B,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB;CA0BzE"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GithubAwsStack = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const iam = tslib_1.__importStar(require("aws-cdk-lib/aws-iam"));
|
|
6
|
-
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
7
|
-
class GithubAwsStack extends aws_cdk_lib_1.Stack {
|
|
8
|
-
constructor(scope, id, props) {
|
|
9
|
-
super(scope, id, props);
|
|
10
|
-
const provider = new iam.OpenIdConnectProvider(this, 'GithubProvider', {
|
|
11
|
-
url: 'https://token.actions.githubusercontent.com',
|
|
12
|
-
clientIds: ['sts.amazonaws.com']
|
|
13
|
-
});
|
|
14
|
-
const role = new iam.Role(this, 'GithubRole', {
|
|
15
|
-
assumedBy: new iam.FederatedPrincipal(provider.openIdConnectProviderArn, {
|
|
16
|
-
StringEquals: {
|
|
17
|
-
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
|
|
18
|
-
"token.actions.githubusercontent.com:sub": `repo:${props.repo}`
|
|
19
|
-
}
|
|
20
|
-
}, "sts:AssumeRoleWithWebIdentity"),
|
|
21
|
-
});
|
|
22
|
-
new aws_cdk_lib_1.CfnOutput(this, 'RoleArn', {
|
|
23
|
-
key: 'roleArn',
|
|
24
|
-
value: role.roleArn
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.GithubAwsStack = GithubAwsStack;
|