@jjrawlins/cdk-diff-pr-github-action 1.5.7 → 1.7.0
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/.jsii +15 -45
- package/cdkdiffprgithubaction/CdkDiffIamTemplate.go +48 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateGenerator.go +82 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateGeneratorProps.go +45 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateGenerator__checks.go +21 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateGenerator__no_checks.go +10 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateProps.go +51 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateStackSet.go +50 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateStackSetCommandsProps.go +29 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateStackSetGenerator.go +87 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateStackSetGeneratorProps.go +33 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateStackSetGenerator__checks.go +29 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateStackSetGenerator__no_checks.go +14 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateStackSetProps.go +58 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateStackSet__checks.go +21 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplateStackSet__no_checks.go +10 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplate__checks.go +21 -0
- package/cdkdiffprgithubaction/CdkDiffIamTemplate__no_checks.go +10 -0
- package/cdkdiffprgithubaction/CdkDiffStack.go +17 -0
- package/cdkdiffprgithubaction/CdkDiffStackWorkflow.go +45 -0
- package/cdkdiffprgithubaction/CdkDiffStackWorkflowProps.go +21 -0
- package/cdkdiffprgithubaction/CdkDiffStackWorkflow__checks.go +21 -0
- package/cdkdiffprgithubaction/CdkDiffStackWorkflow__no_checks.go +10 -0
- package/cdkdiffprgithubaction/CdkDriftDetectionWorkflow.go +45 -0
- package/cdkdiffprgithubaction/CdkDriftDetectionWorkflowProps.go +32 -0
- package/cdkdiffprgithubaction/CdkDriftDetectionWorkflow__checks.go +21 -0
- package/cdkdiffprgithubaction/CdkDriftDetectionWorkflow__no_checks.go +10 -0
- package/cdkdiffprgithubaction/CdkDriftIamTemplate.go +48 -0
- package/cdkdiffprgithubaction/CdkDriftIamTemplateGenerator.go +82 -0
- package/cdkdiffprgithubaction/CdkDriftIamTemplateGeneratorProps.go +17 -0
- package/cdkdiffprgithubaction/CdkDriftIamTemplateGenerator__checks.go +21 -0
- package/cdkdiffprgithubaction/CdkDriftIamTemplateGenerator__no_checks.go +10 -0
- package/cdkdiffprgithubaction/CdkDriftIamTemplateProps.go +23 -0
- package/cdkdiffprgithubaction/CdkDriftIamTemplate__checks.go +21 -0
- package/cdkdiffprgithubaction/CdkDriftIamTemplate__no_checks.go +10 -0
- package/cdkdiffprgithubaction/GitHubOidcConfig.go +20 -0
- package/cdkdiffprgithubaction/LICENSE +202 -0
- package/cdkdiffprgithubaction/README.md +789 -0
- package/cdkdiffprgithubaction/Stack.go +19 -0
- package/cdkdiffprgithubaction/StackSetAutoDeployment.go +14 -0
- package/cdkdiffprgithubaction/StackSetRoleSelection.go +19 -0
- package/cdkdiffprgithubaction/go.mod +13 -0
- package/cdkdiffprgithubaction/jsii/jsii.go +30 -0
- package/cdkdiffprgithubaction/main.go +136 -0
- package/cdkdiffprgithubaction/version +1 -0
- package/lib/CdkDiffIamTemplate.js +2 -2
- package/lib/CdkDiffIamTemplateStackSet.js +2 -2
- package/lib/CdkDiffStackWorkflow.js +1 -1
- package/lib/CdkDriftDetectionWorkflow.js +1 -1
- package/lib/CdkDriftIamTemplate.js +2 -2
- package/package.json +19 -4
- /package/node_modules/{js-yaml/node_modules/argparse → argparse}/LICENSE +0 -0
- /package/node_modules/{js-yaml/node_modules/argparse → argparse}/README.md +0 -0
- /package/node_modules/{js-yaml/node_modules/argparse → argparse}/argparse.js +0 -0
- /package/node_modules/{js-yaml/node_modules/argparse → argparse}/lib/sub.js +0 -0
- /package/node_modules/{js-yaml/node_modules/argparse → argparse}/lib/textwrap.js +0 -0
- /package/node_modules/{js-yaml/node_modules/argparse → argparse}/package.json +0 -0
package/.jsii
CHANGED
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"aws-cdk-lib": "^2.85.0",
|
|
20
|
-
"constructs": ">=10.0.5 <11.0.0"
|
|
21
|
-
"projen": "0.98.29"
|
|
20
|
+
"constructs": ">=10.0.5 <11.0.0"
|
|
22
21
|
},
|
|
23
22
|
"dependencyClosure": {
|
|
24
23
|
"@aws-cdk/asset-awscli-v1": {
|
|
@@ -3481,47 +3480,6 @@
|
|
|
3481
3480
|
"module": "constructs"
|
|
3482
3481
|
}
|
|
3483
3482
|
}
|
|
3484
|
-
},
|
|
3485
|
-
"projen": {
|
|
3486
|
-
"submodules": {
|
|
3487
|
-
"projen.awscdk": {},
|
|
3488
|
-
"projen.build": {},
|
|
3489
|
-
"projen.cdk": {},
|
|
3490
|
-
"projen.cdk8s": {},
|
|
3491
|
-
"projen.cdktf": {},
|
|
3492
|
-
"projen.circleci": {},
|
|
3493
|
-
"projen.github": {},
|
|
3494
|
-
"projen.github.workflows": {},
|
|
3495
|
-
"projen.gitlab": {},
|
|
3496
|
-
"projen.java": {},
|
|
3497
|
-
"projen.javascript": {},
|
|
3498
|
-
"projen.javascript.biome_config": {},
|
|
3499
|
-
"projen.python": {},
|
|
3500
|
-
"projen.python.uvConfig": {},
|
|
3501
|
-
"projen.release": {},
|
|
3502
|
-
"projen.typescript": {},
|
|
3503
|
-
"projen.vscode": {},
|
|
3504
|
-
"projen.web": {}
|
|
3505
|
-
},
|
|
3506
|
-
"targets": {
|
|
3507
|
-
"go": {
|
|
3508
|
-
"moduleName": "github.com/projen/projen-go"
|
|
3509
|
-
},
|
|
3510
|
-
"java": {
|
|
3511
|
-
"maven": {
|
|
3512
|
-
"artifactId": "projen",
|
|
3513
|
-
"groupId": "io.github.cdklabs"
|
|
3514
|
-
},
|
|
3515
|
-
"package": "io.github.cdklabs.projen"
|
|
3516
|
-
},
|
|
3517
|
-
"js": {
|
|
3518
|
-
"npm": "projen"
|
|
3519
|
-
},
|
|
3520
|
-
"python": {
|
|
3521
|
-
"distName": "projen",
|
|
3522
|
-
"module": "projen"
|
|
3523
|
-
}
|
|
3524
|
-
}
|
|
3525
3483
|
}
|
|
3526
3484
|
},
|
|
3527
3485
|
"description": "A GitHub Action that creates a CDK diff for a pull request.",
|
|
@@ -3557,8 +3515,20 @@
|
|
|
3557
3515
|
},
|
|
3558
3516
|
"schema": "jsii/0.10.0",
|
|
3559
3517
|
"targets": {
|
|
3518
|
+
"dotnet": {
|
|
3519
|
+
"namespace": "JJRawlins.CdkDiffPrGithubAction",
|
|
3520
|
+
"packageId": "JJRawlins.CdkDiffPrGithubAction"
|
|
3521
|
+
},
|
|
3522
|
+
"go": {
|
|
3523
|
+
"moduleName": "github.com/JaysonRawlins/cdk-diff-pr-github-action",
|
|
3524
|
+
"packageName": "cdkdiffprgithubaction"
|
|
3525
|
+
},
|
|
3560
3526
|
"js": {
|
|
3561
3527
|
"npm": "@jjrawlins/cdk-diff-pr-github-action"
|
|
3528
|
+
},
|
|
3529
|
+
"python": {
|
|
3530
|
+
"distName": "jjrawlins-cdk-diff-pr-github-action",
|
|
3531
|
+
"module": "jjrawlins_cdk_diff_pr_github_action"
|
|
3562
3532
|
}
|
|
3563
3533
|
},
|
|
3564
3534
|
"types": {
|
|
@@ -5393,6 +5363,6 @@
|
|
|
5393
5363
|
"symbolId": "src/CdkDiffIamTemplateStackSet:StackSetRoleSelection"
|
|
5394
5364
|
}
|
|
5395
5365
|
},
|
|
5396
|
-
"version": "1.
|
|
5397
|
-
"fingerprint": "
|
|
5366
|
+
"version": "1.7.0",
|
|
5367
|
+
"fingerprint": "G7v1ehT4wNtx+qXvKgJLHDSri8Ya1cTAMBXVzYSSaX0="
|
|
5398
5368
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
package cdkdiffprgithubaction
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
|
|
5
|
+
_init_ "github.com/JaysonRawlins/cdk-diff-pr-github-action/cdkdiffprgithubaction/jsii"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
// Projen construct that emits a CloudFormation template with minimal IAM permissions for the CDK Diff Stack Workflow.
|
|
9
|
+
//
|
|
10
|
+
// For non-Projen projects, use `CdkDiffIamTemplateGenerator` directly.
|
|
11
|
+
// Experimental.
|
|
12
|
+
type CdkDiffIamTemplate interface {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// The jsii proxy struct for CdkDiffIamTemplate
|
|
16
|
+
type jsiiProxy_CdkDiffIamTemplate struct {
|
|
17
|
+
_ byte // padding
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Experimental.
|
|
21
|
+
func NewCdkDiffIamTemplate(props *CdkDiffIamTemplateProps) CdkDiffIamTemplate {
|
|
22
|
+
_init_.Initialize()
|
|
23
|
+
|
|
24
|
+
if err := validateNewCdkDiffIamTemplateParameters(props); err != nil {
|
|
25
|
+
panic(err)
|
|
26
|
+
}
|
|
27
|
+
j := jsiiProxy_CdkDiffIamTemplate{}
|
|
28
|
+
|
|
29
|
+
_jsii_.Create(
|
|
30
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplate",
|
|
31
|
+
[]interface{}{props},
|
|
32
|
+
&j,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
return &j
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Experimental.
|
|
39
|
+
func NewCdkDiffIamTemplate_Override(c CdkDiffIamTemplate, props *CdkDiffIamTemplateProps) {
|
|
40
|
+
_init_.Initialize()
|
|
41
|
+
|
|
42
|
+
_jsii_.Create(
|
|
43
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplate",
|
|
44
|
+
[]interface{}{props},
|
|
45
|
+
c,
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
package cdkdiffprgithubaction
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
|
|
5
|
+
_init_ "github.com/JaysonRawlins/cdk-diff-pr-github-action/cdkdiffprgithubaction/jsii"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
// Pure generator class for CDK Diff IAM templates.
|
|
9
|
+
//
|
|
10
|
+
// No Projen dependency - can be used in any project.
|
|
11
|
+
// Experimental.
|
|
12
|
+
type CdkDiffIamTemplateGenerator interface {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// The jsii proxy struct for CdkDiffIamTemplateGenerator
|
|
16
|
+
type jsiiProxy_CdkDiffIamTemplateGenerator struct {
|
|
17
|
+
_ byte // padding
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Experimental.
|
|
21
|
+
func NewCdkDiffIamTemplateGenerator() CdkDiffIamTemplateGenerator {
|
|
22
|
+
_init_.Initialize()
|
|
23
|
+
|
|
24
|
+
j := jsiiProxy_CdkDiffIamTemplateGenerator{}
|
|
25
|
+
|
|
26
|
+
_jsii_.Create(
|
|
27
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplateGenerator",
|
|
28
|
+
nil, // no parameters
|
|
29
|
+
&j,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
return &j
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Experimental.
|
|
36
|
+
func NewCdkDiffIamTemplateGenerator_Override(c CdkDiffIamTemplateGenerator) {
|
|
37
|
+
_init_.Initialize()
|
|
38
|
+
|
|
39
|
+
_jsii_.Create(
|
|
40
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplateGenerator",
|
|
41
|
+
nil, // no parameters
|
|
42
|
+
c,
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Generate the AWS CLI deploy command for the IAM template.
|
|
47
|
+
// Experimental.
|
|
48
|
+
func CdkDiffIamTemplateGenerator_GenerateDeployCommand(templatePath *string) *string {
|
|
49
|
+
_init_.Initialize()
|
|
50
|
+
|
|
51
|
+
var returns *string
|
|
52
|
+
|
|
53
|
+
_jsii_.StaticInvoke(
|
|
54
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplateGenerator",
|
|
55
|
+
"generateDeployCommand",
|
|
56
|
+
[]interface{}{templatePath},
|
|
57
|
+
&returns,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
return returns
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Generate the CloudFormation IAM template as a YAML string.
|
|
64
|
+
// Experimental.
|
|
65
|
+
func CdkDiffIamTemplateGenerator_GenerateTemplate(props *CdkDiffIamTemplateGeneratorProps) *string {
|
|
66
|
+
_init_.Initialize()
|
|
67
|
+
|
|
68
|
+
if err := validateCdkDiffIamTemplateGenerator_GenerateTemplateParameters(props); err != nil {
|
|
69
|
+
panic(err)
|
|
70
|
+
}
|
|
71
|
+
var returns *string
|
|
72
|
+
|
|
73
|
+
_jsii_.StaticInvoke(
|
|
74
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplateGenerator",
|
|
75
|
+
"generateTemplate",
|
|
76
|
+
[]interface{}{props},
|
|
77
|
+
&returns,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
return returns
|
|
81
|
+
}
|
|
82
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
package cdkdiffprgithubaction
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Props for generating CDK Diff IAM templates (no Projen dependency).
|
|
5
|
+
// Experimental.
|
|
6
|
+
type CdkDiffIamTemplateGeneratorProps struct {
|
|
7
|
+
// Name for the changeset IAM role.
|
|
8
|
+
// Experimental.
|
|
9
|
+
RoleName *string `field:"required" json:"roleName" yaml:"roleName"`
|
|
10
|
+
// Create a GitHub OIDC role within this template instead of using an existing one.
|
|
11
|
+
//
|
|
12
|
+
// When true, githubOidc configuration is required and oidcRoleArn is ignored.
|
|
13
|
+
// Default: false.
|
|
14
|
+
// Experimental.
|
|
15
|
+
CreateOidcRole *bool `field:"optional" json:"createOidcRole" yaml:"createOidcRole"`
|
|
16
|
+
// GitHub OIDC configuration for repo/branch restrictions.
|
|
17
|
+
//
|
|
18
|
+
// Required when createOidcRole is true.
|
|
19
|
+
// Experimental.
|
|
20
|
+
GithubOidc *GitHubOidcConfig `field:"optional" json:"githubOidc" yaml:"githubOidc"`
|
|
21
|
+
// Region for the OIDC trust condition.
|
|
22
|
+
//
|
|
23
|
+
// Only used when oidcRoleArn is provided (external OIDC role).
|
|
24
|
+
// Experimental.
|
|
25
|
+
OidcRegion *string `field:"optional" json:"oidcRegion" yaml:"oidcRegion"`
|
|
26
|
+
// ARN of the existing GitHub OIDC role that can assume this changeset role.
|
|
27
|
+
//
|
|
28
|
+
// Required when createOidcRole is false or undefined.
|
|
29
|
+
// Experimental.
|
|
30
|
+
OidcRoleArn *string `field:"optional" json:"oidcRoleArn" yaml:"oidcRoleArn"`
|
|
31
|
+
// Name of the GitHub OIDC role to create.
|
|
32
|
+
//
|
|
33
|
+
// Only used when createOidcRole is true.
|
|
34
|
+
// Default: 'GitHubOIDCRole'.
|
|
35
|
+
// Experimental.
|
|
36
|
+
OidcRoleName *string `field:"optional" json:"oidcRoleName" yaml:"oidcRoleName"`
|
|
37
|
+
// Skip creating the OIDC provider (use existing one).
|
|
38
|
+
//
|
|
39
|
+
// Set to true if the account already has a GitHub OIDC provider.
|
|
40
|
+
// Only used when createOidcRole is true.
|
|
41
|
+
// Default: false.
|
|
42
|
+
// Experimental.
|
|
43
|
+
SkipOidcProviderCreation *bool `field:"optional" json:"skipOidcProviderCreation" yaml:"skipOidcProviderCreation"`
|
|
44
|
+
}
|
|
45
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//go:build !no_runtime_type_checking
|
|
2
|
+
|
|
3
|
+
package cdkdiffprgithubaction
|
|
4
|
+
|
|
5
|
+
import (
|
|
6
|
+
"fmt"
|
|
7
|
+
|
|
8
|
+
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
func validateCdkDiffIamTemplateGenerator_GenerateTemplateParameters(props *CdkDiffIamTemplateGeneratorProps) error {
|
|
12
|
+
if props == nil {
|
|
13
|
+
return fmt.Errorf("parameter props is required, but nil was provided")
|
|
14
|
+
}
|
|
15
|
+
if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil {
|
|
16
|
+
return err
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return nil
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//go:build no_runtime_type_checking
|
|
2
|
+
|
|
3
|
+
package cdkdiffprgithubaction
|
|
4
|
+
|
|
5
|
+
// Building without runtime type checking enabled, so all the below just return nil
|
|
6
|
+
|
|
7
|
+
func validateCdkDiffIamTemplateGenerator_GenerateTemplateParameters(props *CdkDiffIamTemplateGeneratorProps) error {
|
|
8
|
+
return nil
|
|
9
|
+
}
|
|
10
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
package cdkdiffprgithubaction
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Props for the Projen-integrated CDK Diff IAM template construct.
|
|
5
|
+
// Experimental.
|
|
6
|
+
type CdkDiffIamTemplateProps struct {
|
|
7
|
+
// Name for the changeset IAM role.
|
|
8
|
+
// Experimental.
|
|
9
|
+
RoleName *string `field:"required" json:"roleName" yaml:"roleName"`
|
|
10
|
+
// Create a GitHub OIDC role within this template instead of using an existing one.
|
|
11
|
+
//
|
|
12
|
+
// When true, githubOidc configuration is required and oidcRoleArn is ignored.
|
|
13
|
+
// Default: false.
|
|
14
|
+
// Experimental.
|
|
15
|
+
CreateOidcRole *bool `field:"optional" json:"createOidcRole" yaml:"createOidcRole"`
|
|
16
|
+
// GitHub OIDC configuration for repo/branch restrictions.
|
|
17
|
+
//
|
|
18
|
+
// Required when createOidcRole is true.
|
|
19
|
+
// Experimental.
|
|
20
|
+
GithubOidc *GitHubOidcConfig `field:"optional" json:"githubOidc" yaml:"githubOidc"`
|
|
21
|
+
// Region for the OIDC trust condition.
|
|
22
|
+
//
|
|
23
|
+
// Only used when oidcRoleArn is provided (external OIDC role).
|
|
24
|
+
// Experimental.
|
|
25
|
+
OidcRegion *string `field:"optional" json:"oidcRegion" yaml:"oidcRegion"`
|
|
26
|
+
// ARN of the existing GitHub OIDC role that can assume this changeset role.
|
|
27
|
+
//
|
|
28
|
+
// Required when createOidcRole is false or undefined.
|
|
29
|
+
// Experimental.
|
|
30
|
+
OidcRoleArn *string `field:"optional" json:"oidcRoleArn" yaml:"oidcRoleArn"`
|
|
31
|
+
// Name of the GitHub OIDC role to create.
|
|
32
|
+
//
|
|
33
|
+
// Only used when createOidcRole is true.
|
|
34
|
+
// Default: 'GitHubOIDCRole'.
|
|
35
|
+
// Experimental.
|
|
36
|
+
OidcRoleName *string `field:"optional" json:"oidcRoleName" yaml:"oidcRoleName"`
|
|
37
|
+
// Skip creating the OIDC provider (use existing one).
|
|
38
|
+
//
|
|
39
|
+
// Set to true if the account already has a GitHub OIDC provider.
|
|
40
|
+
// Only used when createOidcRole is true.
|
|
41
|
+
// Default: false.
|
|
42
|
+
// Experimental.
|
|
43
|
+
SkipOidcProviderCreation *bool `field:"optional" json:"skipOidcProviderCreation" yaml:"skipOidcProviderCreation"`
|
|
44
|
+
// Projen project instance.
|
|
45
|
+
// Experimental.
|
|
46
|
+
Project interface{} `field:"required" json:"project" yaml:"project"`
|
|
47
|
+
// Output path for the template file (default: 'cdk-diff-workflow-iam-template.yaml').
|
|
48
|
+
// Experimental.
|
|
49
|
+
OutputPath *string `field:"optional" json:"outputPath" yaml:"outputPath"`
|
|
50
|
+
}
|
|
51
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
package cdkdiffprgithubaction
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
|
|
5
|
+
_init_ "github.com/JaysonRawlins/cdk-diff-pr-github-action/cdkdiffprgithubaction/jsii"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
// Projen construct that creates a CloudFormation StackSet template for org-wide deployment of GitHub OIDC provider, OIDC role, and CDK Diff/Drift IAM roles.
|
|
9
|
+
//
|
|
10
|
+
// This provides a self-contained per-account deployment with no role chaining required.
|
|
11
|
+
//
|
|
12
|
+
// For non-Projen projects, use `CdkDiffIamTemplateStackSetGenerator` directly.
|
|
13
|
+
// Experimental.
|
|
14
|
+
type CdkDiffIamTemplateStackSet interface {
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// The jsii proxy struct for CdkDiffIamTemplateStackSet
|
|
18
|
+
type jsiiProxy_CdkDiffIamTemplateStackSet struct {
|
|
19
|
+
_ byte // padding
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Experimental.
|
|
23
|
+
func NewCdkDiffIamTemplateStackSet(props *CdkDiffIamTemplateStackSetProps) CdkDiffIamTemplateStackSet {
|
|
24
|
+
_init_.Initialize()
|
|
25
|
+
|
|
26
|
+
if err := validateNewCdkDiffIamTemplateStackSetParameters(props); err != nil {
|
|
27
|
+
panic(err)
|
|
28
|
+
}
|
|
29
|
+
j := jsiiProxy_CdkDiffIamTemplateStackSet{}
|
|
30
|
+
|
|
31
|
+
_jsii_.Create(
|
|
32
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplateStackSet",
|
|
33
|
+
[]interface{}{props},
|
|
34
|
+
&j,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
return &j
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Experimental.
|
|
41
|
+
func NewCdkDiffIamTemplateStackSet_Override(c CdkDiffIamTemplateStackSet, props *CdkDiffIamTemplateStackSetProps) {
|
|
42
|
+
_init_.Initialize()
|
|
43
|
+
|
|
44
|
+
_jsii_.Create(
|
|
45
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplateStackSet",
|
|
46
|
+
[]interface{}{props},
|
|
47
|
+
c,
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
package cdkdiffprgithubaction
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Props for generating StackSet CLI commands (no Projen dependency).
|
|
5
|
+
// Experimental.
|
|
6
|
+
type CdkDiffIamTemplateStackSetCommandsProps struct {
|
|
7
|
+
// Auto-deployment configuration.
|
|
8
|
+
// Experimental.
|
|
9
|
+
AutoDeployment *StackSetAutoDeployment `field:"optional" json:"autoDeployment" yaml:"autoDeployment"`
|
|
10
|
+
// Whether to use delegated admin mode for StackSet operations.
|
|
11
|
+
//
|
|
12
|
+
// If true, adds --call-as DELEGATED_ADMIN to commands.
|
|
13
|
+
// Default: true.
|
|
14
|
+
// Experimental.
|
|
15
|
+
DelegatedAdmin *bool `field:"optional" json:"delegatedAdmin" yaml:"delegatedAdmin"`
|
|
16
|
+
// Target regions for deployment (e.g., ['us-east-1', 'eu-west-1']).
|
|
17
|
+
// Experimental.
|
|
18
|
+
Regions *[]*string `field:"optional" json:"regions" yaml:"regions"`
|
|
19
|
+
// Name of the StackSet (default: 'cdk-diff-workflow-iam-stackset').
|
|
20
|
+
// Experimental.
|
|
21
|
+
StackSetName *string `field:"optional" json:"stackSetName" yaml:"stackSetName"`
|
|
22
|
+
// Target OUs for deployment (e.g., ['ou-xxxx-xxxxxxxx', 'r-xxxx']).
|
|
23
|
+
// Experimental.
|
|
24
|
+
TargetOrganizationalUnitIds *[]*string `field:"optional" json:"targetOrganizationalUnitIds" yaml:"targetOrganizationalUnitIds"`
|
|
25
|
+
// Path to the template file (default: 'cdk-diff-workflow-stackset-template.yaml').
|
|
26
|
+
// Experimental.
|
|
27
|
+
TemplatePath *string `field:"optional" json:"templatePath" yaml:"templatePath"`
|
|
28
|
+
}
|
|
29
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
package cdkdiffprgithubaction
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
|
|
5
|
+
_init_ "github.com/JaysonRawlins/cdk-diff-pr-github-action/cdkdiffprgithubaction/jsii"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
// Pure generator class for StackSet templates and commands.
|
|
9
|
+
//
|
|
10
|
+
// No Projen dependency - can be used in any project.
|
|
11
|
+
// Experimental.
|
|
12
|
+
type CdkDiffIamTemplateStackSetGenerator interface {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// The jsii proxy struct for CdkDiffIamTemplateStackSetGenerator
|
|
16
|
+
type jsiiProxy_CdkDiffIamTemplateStackSetGenerator struct {
|
|
17
|
+
_ byte // padding
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Experimental.
|
|
21
|
+
func NewCdkDiffIamTemplateStackSetGenerator() CdkDiffIamTemplateStackSetGenerator {
|
|
22
|
+
_init_.Initialize()
|
|
23
|
+
|
|
24
|
+
j := jsiiProxy_CdkDiffIamTemplateStackSetGenerator{}
|
|
25
|
+
|
|
26
|
+
_jsii_.Create(
|
|
27
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplateStackSetGenerator",
|
|
28
|
+
nil, // no parameters
|
|
29
|
+
&j,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
return &j
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Experimental.
|
|
36
|
+
func NewCdkDiffIamTemplateStackSetGenerator_Override(c CdkDiffIamTemplateStackSetGenerator) {
|
|
37
|
+
_init_.Initialize()
|
|
38
|
+
|
|
39
|
+
_jsii_.Create(
|
|
40
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplateStackSetGenerator",
|
|
41
|
+
nil, // no parameters
|
|
42
|
+
c,
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Generate AWS CLI commands for StackSet operations.
|
|
47
|
+
//
|
|
48
|
+
// Returns a map of command names to shell commands.
|
|
49
|
+
// Experimental.
|
|
50
|
+
func CdkDiffIamTemplateStackSetGenerator_GenerateCommands(props *CdkDiffIamTemplateStackSetCommandsProps) *map[string]*string {
|
|
51
|
+
_init_.Initialize()
|
|
52
|
+
|
|
53
|
+
if err := validateCdkDiffIamTemplateStackSetGenerator_GenerateCommandsParameters(props); err != nil {
|
|
54
|
+
panic(err)
|
|
55
|
+
}
|
|
56
|
+
var returns *map[string]*string
|
|
57
|
+
|
|
58
|
+
_jsii_.StaticInvoke(
|
|
59
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplateStackSetGenerator",
|
|
60
|
+
"generateCommands",
|
|
61
|
+
[]interface{}{props},
|
|
62
|
+
&returns,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
return returns
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Generate the CloudFormation StackSet template as a YAML string.
|
|
69
|
+
// Experimental.
|
|
70
|
+
func CdkDiffIamTemplateStackSetGenerator_GenerateTemplate(props *CdkDiffIamTemplateStackSetGeneratorProps) *string {
|
|
71
|
+
_init_.Initialize()
|
|
72
|
+
|
|
73
|
+
if err := validateCdkDiffIamTemplateStackSetGenerator_GenerateTemplateParameters(props); err != nil {
|
|
74
|
+
panic(err)
|
|
75
|
+
}
|
|
76
|
+
var returns *string
|
|
77
|
+
|
|
78
|
+
_jsii_.StaticInvoke(
|
|
79
|
+
"@jjrawlins/cdk-diff-pr-github-action.CdkDiffIamTemplateStackSetGenerator",
|
|
80
|
+
"generateTemplate",
|
|
81
|
+
[]interface{}{props},
|
|
82
|
+
&returns,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return returns
|
|
86
|
+
}
|
|
87
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
package cdkdiffprgithubaction
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Props for generating StackSet templates (no Projen dependency).
|
|
5
|
+
// Experimental.
|
|
6
|
+
type CdkDiffIamTemplateStackSetGeneratorProps struct {
|
|
7
|
+
// GitHub OIDC configuration for repo/branch restrictions.
|
|
8
|
+
// Experimental.
|
|
9
|
+
GithubOidc *GitHubOidcConfig `field:"required" json:"githubOidc" yaml:"githubOidc"`
|
|
10
|
+
// Name of the CdkChangesetRole (default: 'CdkChangesetRole').
|
|
11
|
+
// Experimental.
|
|
12
|
+
ChangesetRoleName *string `field:"optional" json:"changesetRoleName" yaml:"changesetRoleName"`
|
|
13
|
+
// Description for the StackSet.
|
|
14
|
+
// Experimental.
|
|
15
|
+
Description *string `field:"optional" json:"description" yaml:"description"`
|
|
16
|
+
// Name of the CdkDriftRole (default: 'CdkDriftRole').
|
|
17
|
+
// Experimental.
|
|
18
|
+
DriftRoleName *string `field:"optional" json:"driftRoleName" yaml:"driftRoleName"`
|
|
19
|
+
// Name of the GitHub OIDC role (default: 'GitHubOIDCRole').
|
|
20
|
+
// Experimental.
|
|
21
|
+
OidcRoleName *string `field:"optional" json:"oidcRoleName" yaml:"oidcRoleName"`
|
|
22
|
+
// Which roles to include (default: BOTH).
|
|
23
|
+
// Experimental.
|
|
24
|
+
RoleSelection StackSetRoleSelection `field:"optional" json:"roleSelection" yaml:"roleSelection"`
|
|
25
|
+
// Skip creating the OIDC provider (use existing one).
|
|
26
|
+
//
|
|
27
|
+
// Set to true if accounts already have a GitHub OIDC provider.
|
|
28
|
+
// The template will reference the existing provider by ARN.
|
|
29
|
+
// Default: false.
|
|
30
|
+
// Experimental.
|
|
31
|
+
SkipOidcProviderCreation *bool `field:"optional" json:"skipOidcProviderCreation" yaml:"skipOidcProviderCreation"`
|
|
32
|
+
}
|
|
33
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//go:build !no_runtime_type_checking
|
|
2
|
+
|
|
3
|
+
package cdkdiffprgithubaction
|
|
4
|
+
|
|
5
|
+
import (
|
|
6
|
+
"fmt"
|
|
7
|
+
|
|
8
|
+
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
func validateCdkDiffIamTemplateStackSetGenerator_GenerateCommandsParameters(props *CdkDiffIamTemplateStackSetCommandsProps) error {
|
|
12
|
+
if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil {
|
|
13
|
+
return err
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return nil
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
func validateCdkDiffIamTemplateStackSetGenerator_GenerateTemplateParameters(props *CdkDiffIamTemplateStackSetGeneratorProps) error {
|
|
20
|
+
if props == nil {
|
|
21
|
+
return fmt.Errorf("parameter props is required, but nil was provided")
|
|
22
|
+
}
|
|
23
|
+
if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil {
|
|
24
|
+
return err
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//go:build no_runtime_type_checking
|
|
2
|
+
|
|
3
|
+
package cdkdiffprgithubaction
|
|
4
|
+
|
|
5
|
+
// Building without runtime type checking enabled, so all the below just return nil
|
|
6
|
+
|
|
7
|
+
func validateCdkDiffIamTemplateStackSetGenerator_GenerateCommandsParameters(props *CdkDiffIamTemplateStackSetCommandsProps) error {
|
|
8
|
+
return nil
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
func validateCdkDiffIamTemplateStackSetGenerator_GenerateTemplateParameters(props *CdkDiffIamTemplateStackSetGeneratorProps) error {
|
|
12
|
+
return nil
|
|
13
|
+
}
|
|
14
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
package cdkdiffprgithubaction
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
// Props for the Projen-integrated StackSet construct.
|
|
5
|
+
// Experimental.
|
|
6
|
+
type CdkDiffIamTemplateStackSetProps struct {
|
|
7
|
+
// GitHub OIDC configuration for repo/branch restrictions.
|
|
8
|
+
// Experimental.
|
|
9
|
+
GithubOidc *GitHubOidcConfig `field:"required" json:"githubOidc" yaml:"githubOidc"`
|
|
10
|
+
// Name of the CdkChangesetRole (default: 'CdkChangesetRole').
|
|
11
|
+
// Experimental.
|
|
12
|
+
ChangesetRoleName *string `field:"optional" json:"changesetRoleName" yaml:"changesetRoleName"`
|
|
13
|
+
// Description for the StackSet.
|
|
14
|
+
// Experimental.
|
|
15
|
+
Description *string `field:"optional" json:"description" yaml:"description"`
|
|
16
|
+
// Name of the CdkDriftRole (default: 'CdkDriftRole').
|
|
17
|
+
// Experimental.
|
|
18
|
+
DriftRoleName *string `field:"optional" json:"driftRoleName" yaml:"driftRoleName"`
|
|
19
|
+
// Name of the GitHub OIDC role (default: 'GitHubOIDCRole').
|
|
20
|
+
// Experimental.
|
|
21
|
+
OidcRoleName *string `field:"optional" json:"oidcRoleName" yaml:"oidcRoleName"`
|
|
22
|
+
// Which roles to include (default: BOTH).
|
|
23
|
+
// Experimental.
|
|
24
|
+
RoleSelection StackSetRoleSelection `field:"optional" json:"roleSelection" yaml:"roleSelection"`
|
|
25
|
+
// Skip creating the OIDC provider (use existing one).
|
|
26
|
+
//
|
|
27
|
+
// Set to true if accounts already have a GitHub OIDC provider.
|
|
28
|
+
// The template will reference the existing provider by ARN.
|
|
29
|
+
// Default: false.
|
|
30
|
+
// Experimental.
|
|
31
|
+
SkipOidcProviderCreation *bool `field:"optional" json:"skipOidcProviderCreation" yaml:"skipOidcProviderCreation"`
|
|
32
|
+
// Projen project instance.
|
|
33
|
+
// Experimental.
|
|
34
|
+
Project interface{} `field:"required" json:"project" yaml:"project"`
|
|
35
|
+
// Auto-deployment configuration.
|
|
36
|
+
// Experimental.
|
|
37
|
+
AutoDeployment *StackSetAutoDeployment `field:"optional" json:"autoDeployment" yaml:"autoDeployment"`
|
|
38
|
+
// Whether to use delegated admin mode for StackSet operations.
|
|
39
|
+
//
|
|
40
|
+
// If true, adds --call-as DELEGATED_ADMIN to commands.
|
|
41
|
+
// If false, assumes running from the management account.
|
|
42
|
+
// Default: true.
|
|
43
|
+
// Experimental.
|
|
44
|
+
DelegatedAdmin *bool `field:"optional" json:"delegatedAdmin" yaml:"delegatedAdmin"`
|
|
45
|
+
// Output path for the template file (default: 'cdk-diff-workflow-stackset-template.yaml').
|
|
46
|
+
// Experimental.
|
|
47
|
+
OutputPath *string `field:"optional" json:"outputPath" yaml:"outputPath"`
|
|
48
|
+
// Target regions for deployment (e.g., ['us-east-1', 'eu-west-1']).
|
|
49
|
+
// Experimental.
|
|
50
|
+
Regions *[]*string `field:"optional" json:"regions" yaml:"regions"`
|
|
51
|
+
// Name of the StackSet (default: 'cdk-diff-workflow-iam-stackset').
|
|
52
|
+
// Experimental.
|
|
53
|
+
StackSetName *string `field:"optional" json:"stackSetName" yaml:"stackSetName"`
|
|
54
|
+
// Target OUs for deployment (e.g., ['ou-xxxx-xxxxxxxx', 'r-xxxx']).
|
|
55
|
+
// Experimental.
|
|
56
|
+
TargetOrganizationalUnitIds *[]*string `field:"optional" json:"targetOrganizationalUnitIds" yaml:"targetOrganizationalUnitIds"`
|
|
57
|
+
}
|
|
58
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//go:build !no_runtime_type_checking
|
|
2
|
+
|
|
3
|
+
package cdkdiffprgithubaction
|
|
4
|
+
|
|
5
|
+
import (
|
|
6
|
+
"fmt"
|
|
7
|
+
|
|
8
|
+
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
func validateNewCdkDiffIamTemplateStackSetParameters(props *CdkDiffIamTemplateStackSetProps) error {
|
|
12
|
+
if props == nil {
|
|
13
|
+
return fmt.Errorf("parameter props is required, but nil was provided")
|
|
14
|
+
}
|
|
15
|
+
if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil {
|
|
16
|
+
return err
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return nil
|
|
20
|
+
}
|
|
21
|
+
|