AnimeshShaw commited on
Commit
d16079c
·
1 Parent(s): 43cd3eb

Add human_reference_dataset/iac-model-evaluation/cdk/

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/.gitignore +20 -0
  2. human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/README.md +12 -0
  3. human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/api_gateway.go +79 -0
  4. human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/api_gateway_test.go +26 -0
  5. human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/cdk.json +62 -0
  6. human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/go.mod +25 -0
  7. human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/go.sum +51 -0
  8. human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/lambda/main.go +14 -0
  9. human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/response.json +1 -0
  10. human_reference_dataset/iac-model-evaluation/cdk/go/bucket/.gitignore +21 -0
  11. human_reference_dataset/iac-model-evaluation/cdk/go/bucket/README.md +12 -0
  12. human_reference_dataset/iac-model-evaluation/cdk/go/bucket/bucket.go +71 -0
  13. human_reference_dataset/iac-model-evaluation/cdk/go/bucket/cdk.json +59 -0
  14. human_reference_dataset/iac-model-evaluation/cdk/go/bucket/go.mod +24 -0
  15. human_reference_dataset/iac-model-evaluation/cdk/go/bucket/go.sum +49 -0
  16. human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/.gitignore +19 -0
  17. human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/README.md +12 -0
  18. human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/cdk.json +62 -0
  19. human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/cloudfront.go +70 -0
  20. human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/cloudfront_test.go +26 -0
  21. human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/go.mod +24 -0
  22. human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/.gitignore +19 -0
  23. human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/README.md +12 -0
  24. human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/cdk.json +62 -0
  25. human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/dynamodb_table.go +72 -0
  26. human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/dynamodb_table_test.go +26 -0
  27. human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/go.mod +24 -0
  28. human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/go.sum +49 -0
  29. human_reference_dataset/iac-model-evaluation/cdk/go/ec2/.gitignore +19 -0
  30. human_reference_dataset/iac-model-evaluation/cdk/go/ec2/README.md +17 -0
  31. human_reference_dataset/iac-model-evaluation/cdk/go/ec2/cdk.json +60 -0
  32. human_reference_dataset/iac-model-evaluation/cdk/go/ec2/ec2.go +116 -0
  33. human_reference_dataset/iac-model-evaluation/cdk/go/ec2/ec2_test.go +26 -0
  34. human_reference_dataset/iac-model-evaluation/cdk/go/ec2/go.mod +14 -0
  35. human_reference_dataset/iac-model-evaluation/cdk/go/efs/.gitignore +19 -0
  36. human_reference_dataset/iac-model-evaluation/cdk/go/efs/README.md +12 -0
  37. human_reference_dataset/iac-model-evaluation/cdk/go/efs/cdk.json +62 -0
  38. human_reference_dataset/iac-model-evaluation/cdk/go/efs/efs.go +169 -0
  39. human_reference_dataset/iac-model-evaluation/cdk/go/efs/efs_test.go +26 -0
  40. human_reference_dataset/iac-model-evaluation/cdk/go/efs/go.mod +26 -0
  41. human_reference_dataset/iac-model-evaluation/cdk/go/efs/go.sum +53 -0
  42. human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/.gitignore +19 -0
  43. human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/README.md +12 -0
  44. human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/cdk.json +62 -0
  45. human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/go.mod +24 -0
  46. human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/kinesis.go +76 -0
  47. human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/kinesis_test.go +26 -0
  48. human_reference_dataset/iac-model-evaluation/cdk/go/lambda/.gitignore +19 -0
  49. human_reference_dataset/iac-model-evaluation/cdk/go/lambda/README.md +12 -0
  50. human_reference_dataset/iac-model-evaluation/cdk/go/lambda/cdk.json +62 -0
human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/.gitignore ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Binaries for programs and plugins
2
+ *.exe
3
+ *.exe~
4
+ *.dll
5
+ *.so
6
+ *.dylib
7
+
8
+ # Test binary, built with `go test -c`
9
+ *.test
10
+
11
+ # Output of the go coverage tool, specifically when used with LiteIDE
12
+ *.out
13
+
14
+ # go.sum should be committed
15
+ !go.sum
16
+
17
+ # CDK asset staging directory
18
+ .cdk.staging
19
+ cdk.out
20
+ aws/
human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to your CDK Go project!
2
+
3
+ This is a blank project for CDK development with Go.
4
+
5
+ The `cdk.json` file tells the CDK toolkit how to execute your app.
6
+
7
+ ## Useful commands
8
+
9
+ * `cdk deploy` deploy this stack to your default AWS account/region
10
+ * `cdk diff` compare deployed stack with current state
11
+ * `cdk synth` emits the synthesized CloudFormation template
12
+ * `go test` run unit tests
human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/api_gateway.go ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ import (
4
+ "github.com/aws/aws-cdk-go/awscdk/v2"
5
+ "github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway"
6
+ "github.com/aws/aws-cdk-go/awscdk/v2/awslambda"
7
+ "github.com/aws/constructs-go/constructs/v10"
8
+ "github.com/aws/jsii-runtime-go"
9
+ )
10
+
11
+ type GoIacStackProps struct {
12
+ awscdk.StackProps
13
+ }
14
+
15
+ func NewGoIacStack(scope constructs.Construct, id string, props *GoIacStackProps) awscdk.Stack {
16
+ var sprops awscdk.StackProps
17
+ if props != nil {
18
+ sprops = props.StackProps
19
+ }
20
+ stack := awscdk.NewStack(scope, &id, &sprops)
21
+
22
+ // Create Lambda function
23
+ lambdaFunction := awslambda.NewFunction(stack, jsii.String("MyLambda"), &awslambda.FunctionProps{
24
+ Runtime: awslambda.Runtime_GO_1_X(),
25
+ Handler: jsii.String("main"),
26
+ Code: awslambda.Code_FromAsset(jsii.String("lambda"), nil),
27
+ })
28
+
29
+ // Create API Gateway Rest API with a Lambda function as an integration request
30
+ awsapigateway.NewLambdaRestApi(stack, jsii.String("MyApiEndpoint"), &awsapigateway.LambdaRestApiProps{
31
+ Handler: lambdaFunction,
32
+ EndpointConfiguration: &awsapigateway.EndpointConfiguration{
33
+ Types: &[]awsapigateway.EndpointType{awsapigateway.EndpointType_REGIONAL},
34
+ },
35
+ })
36
+
37
+ return stack
38
+ }
39
+
40
+ func main() {
41
+ defer jsii.Close()
42
+
43
+ app := awscdk.NewApp(nil)
44
+
45
+ NewGoIacStack(app, "ApiGateway", &GoIacStackProps{
46
+ awscdk.StackProps{
47
+ Env: env(),
48
+ },
49
+ })
50
+
51
+ app.Synth(nil)
52
+ }
53
+
54
+ // env determines the AWS environment (account+region) in which our stack is to
55
+ // be deployed. For more information see: https://docs.aws.amazon.com/cdk/latest/guide/environments.html
56
+ func env() *awscdk.Environment {
57
+ // If unspecified, this stack will be "environment-agnostic".
58
+ // Account/Region-dependent features and context lookups will not work, but a
59
+ // single synthesized template can be deployed anywhere.
60
+ //---------------------------------------------------------------------------
61
+ return nil
62
+
63
+ // Uncomment if you know exactly what account and region you want to deploy
64
+ // the stack to. This is the recommendation for production stacks.
65
+ //---------------------------------------------------------------------------
66
+ // return &awscdk.Environment{
67
+ // Account: jsii.String("123456789012"),
68
+ // Region: jsii.String("us-east-1"),
69
+ // }
70
+
71
+ // Uncomment to specialize this stack for the AWS Account and Region that are
72
+ // implied by the current CLI configuration. This is recommended for dev
73
+ // stacks.
74
+ //---------------------------------------------------------------------------
75
+ // return &awscdk.Environment{
76
+ // Account: jsii.String(os.Getenv("CDK_DEFAULT_ACCOUNT")),
77
+ // Region: jsii.String(os.Getenv("CDK_DEFAULT_REGION")),
78
+ // }
79
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/api_gateway_test.go ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ // import (
4
+ // "testing"
5
+
6
+ // "github.com/aws/aws-cdk-go/awscdk/v2"
7
+ // "github.com/aws/aws-cdk-go/awscdk/v2/assertions"
8
+ // "github.com/aws/jsii-runtime-go"
9
+ // )
10
+
11
+ // example tests. To run these tests, uncomment this file along with the
12
+ // example resource in api_gateway.go
13
+ // func TestGoIacStack(t *testing.T) {
14
+ // // GIVEN
15
+ // app := awscdk.NewApp(nil)
16
+
17
+ // // WHEN
18
+ // stack := NewGoIacStack(app, "MyStack", nil)
19
+
20
+ // // THEN
21
+ // template := assertions.Template_FromStack(stack, nil)
22
+
23
+ // template.HasResourceProperties(jsii.String("AWS::SQS::Queue"), map[string]interface{}{
24
+ // "VisibilityTimeout": 300,
25
+ // })
26
+ // }
human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/cdk.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "app": "go mod download && go run api_gateway.go",
3
+ "watch": {
4
+ "include": [
5
+ "**"
6
+ ],
7
+ "exclude": [
8
+ "README.md",
9
+ "cdk*.json",
10
+ "go.mod",
11
+ "go.sum",
12
+ "**/*test.go"
13
+ ]
14
+ },
15
+ "context": {
16
+ "@aws-cdk/aws-lambda:recognizeLayerVersion": true,
17
+ "@aws-cdk/core:checkSecretUsage": true,
18
+ "@aws-cdk/core:target-partitions": [
19
+ "aws",
20
+ "aws-cn"
21
+ ],
22
+ "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
23
+ "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
24
+ "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
25
+ "@aws-cdk/aws-iam:minimizePolicies": true,
26
+ "@aws-cdk/core:validateSnapshotRemovalPolicy": true,
27
+ "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
28
+ "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
29
+ "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
30
+ "@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
31
+ "@aws-cdk/core:enablePartitionLiterals": true,
32
+ "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
33
+ "@aws-cdk/aws-iam:standardizedServicePrincipals": true,
34
+ "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
35
+ "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
36
+ "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
37
+ "@aws-cdk/aws-route53-patters:useCertificate": true,
38
+ "@aws-cdk/customresources:installLatestAwsSdkDefault": false,
39
+ "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
40
+ "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
41
+ "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
42
+ "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
43
+ "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
44
+ "@aws-cdk/aws-redshift:columnId": true,
45
+ "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
46
+ "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
47
+ "@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
48
+ "@aws-cdk/aws-kms:aliasNameRef": true,
49
+ "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
50
+ "@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
51
+ "@aws-cdk/aws-efs:denyAnonymousAccess": true,
52
+ "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
53
+ "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
54
+ "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
55
+ "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
56
+ "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
57
+ "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
58
+ "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
59
+ "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true,
60
+ "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true
61
+ }
62
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/go.mod ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module api_gateway
2
+
3
+ go 1.18
4
+
5
+ require (
6
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.127.0
7
+ github.com/aws/aws-lambda-go v1.46.0
8
+ github.com/aws/constructs-go/constructs/v10 v10.3.0
9
+ github.com/aws/jsii-runtime-go v1.94.0
10
+ )
11
+
12
+ require (
13
+ github.com/Masterminds/semver/v3 v3.2.1 // indirect
14
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 // indirect
15
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 // indirect
16
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 // indirect
17
+ github.com/fatih/color v1.16.0 // indirect
18
+ github.com/mattn/go-colorable v0.1.13 // indirect
19
+ github.com/mattn/go-isatty v0.0.20 // indirect
20
+ github.com/yuin/goldmark v1.4.13 // indirect
21
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
22
+ golang.org/x/mod v0.14.0 // indirect
23
+ golang.org/x/sys v0.14.0 // indirect
24
+ golang.org/x/tools v0.16.1 // indirect
25
+ )
human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/go.sum ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
2
+ github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
3
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.127.0 h1:toQoTegbYFa36s2LFkr1LDA5oLy/aC4nRpAMbof0foc=
4
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.127.0/go.mod h1:TpmJwOnoajvRtwnLlJoxEoppb9sVoCLfPGLdgoTDH7o=
5
+ github.com/aws/aws-lambda-go v1.46.0 h1:UWVnvh2h2gecOlFhHQfIPQcD8pL/f7pVCutmFl+oXU8=
6
+ github.com/aws/aws-lambda-go v1.46.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A=
7
+ github.com/aws/constructs-go/constructs/v10 v10.3.0 h1:LsjBIMiaDX/vqrXWhzTquBJ9pPdi02/H+z1DCwg0PEM=
8
+ github.com/aws/constructs-go/constructs/v10 v10.3.0/go.mod h1:GgzwIwoRJ2UYsr3SU+JhAl+gq5j39bEMYf8ev3J+s9s=
9
+ github.com/aws/jsii-runtime-go v1.94.0 h1:VuVDx0xL2gbsJthUMfP+SwAXGkSEQd0GKm0ydZ8xga8=
10
+ github.com/aws/jsii-runtime-go v1.94.0/go.mod h1:tQOz8aAMzM2XsRUDsnUgPvGcHNAzR/xtH0OgeM0lTWo=
11
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 h1:VixXB9DnHN8oP7pXipq8GVFPjWCOdeNxIaS/ZyUwTkI=
12
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202/go.mod h1:iPUti/SWjA3XAS3CpnLciFjS8TN9Y+8mdZgDfSgcyus=
13
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 h1:k+WD+6cERd59Mao84v0QtRrcdZuuSMfzlEmuIypKnVs=
14
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2/go.mod h1:CvFHBo0qcg8LUkJqIxQtP1rD/sNGv9bX3L2vHT2FUAo=
15
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 h1:MBBQNKKPJ5GArbctgwpiCy7KmwGjHDjUUH5wEzwIq8w=
16
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1/go.mod h1:/2WiXEft9s8ViJjD01CJqDuyJ8HXBjhBLtK5OvJfdSc=
17
+ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
18
+ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
19
+ github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
20
+ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
21
+ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
22
+ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
23
+ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
24
+ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
25
+ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
26
+ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
27
+ github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
28
+ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
29
+ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
30
+ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
31
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
32
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
33
+ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
34
+ golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
35
+ golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
36
+ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
37
+ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
38
+ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
39
+ golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
40
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
41
+ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
42
+ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
43
+ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
44
+ golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
45
+ golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
46
+ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
47
+ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
48
+ golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA=
49
+ golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
50
+ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
51
+ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/lambda/main.go ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ import (
4
+ "github.com/aws/aws-lambda-go/lambda"
5
+ )
6
+
7
+ func hello() (string, error) {
8
+ return "Hello λ!", nil
9
+ }
10
+
11
+ func main() {
12
+ // call hello function
13
+ lambda.Start(hello)
14
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/api_gateway/response.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"errorType":"Runtime.ExitError","errorMessage":"RequestId: 2dce9457-079f-4296-815f-dfb9e7db960d Error: Runtime exited with error: exit status 1"}
human_reference_dataset/iac-model-evaluation/cdk/go/bucket/.gitignore ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Binaries for programs and plugins
2
+ *.exe
3
+ *.exe~
4
+ *.dll
5
+ *.so
6
+ *.dylib
7
+
8
+ # Test binary, built with `go test -c`
9
+ *.test
10
+
11
+ # Output of the go coverage tool, specifically when used with LiteIDE
12
+ *.out
13
+
14
+ # go.sum should be committed
15
+ !go.sum
16
+
17
+ # CDK asset staging directory
18
+ .cdk.staging
19
+ cdk.out
20
+
21
+ bucket
human_reference_dataset/iac-model-evaluation/cdk/go/bucket/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to your CDK Go project!
2
+
3
+ This is a blank project for CDK development with Go.
4
+
5
+ The `cdk.json` file tells the CDK toolkit how to execute your app.
6
+
7
+ ## Useful commands
8
+
9
+ * `cdk deploy` deploy this stack to your default AWS account/region
10
+ * `cdk diff` compare deployed stack with current state
11
+ * `cdk synth` emits the synthesized CloudFormation template
12
+ * `go test` run unit tests
human_reference_dataset/iac-model-evaluation/cdk/go/bucket/bucket.go ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // A stack that creates a new S3 bucket
2
+ package main
3
+
4
+ import (
5
+ "github.com/aws/aws-cdk-go/awscdk/v2"
6
+ "github.com/aws/aws-cdk-go/awscdk/v2/awss3"
7
+ "github.com/aws/constructs-go/constructs/v10"
8
+ "github.com/aws/jsii-runtime-go"
9
+ )
10
+
11
+ type BucketStackProps struct {
12
+ awscdk.StackProps
13
+ }
14
+
15
+ func NewBucketStack(scope constructs.Construct, id string, props *BucketStackProps) awscdk.Stack {
16
+ var sprops awscdk.StackProps
17
+ if props != nil {
18
+ sprops = props.StackProps
19
+ }
20
+ stack := awscdk.NewStack(scope, &id, &sprops)
21
+
22
+ // Create an S3 bucket that blocks public access and is versioned
23
+ awss3.NewBucket(stack, jsii.String("Bucket"), &awss3.BucketProps{
24
+ BlockPublicAccess: awss3.BlockPublicAccess_BLOCK_ALL(),
25
+ PublicReadAccess: jsii.Bool(false),
26
+ Versioned: jsii.Bool(true),
27
+ })
28
+
29
+ return stack
30
+ }
31
+
32
+ func main() {
33
+ defer jsii.Close()
34
+
35
+ app := awscdk.NewApp(nil)
36
+
37
+ NewBucketStack(app, "BucketStack", &BucketStackProps{
38
+ awscdk.StackProps{
39
+ Env: env(),
40
+ },
41
+ })
42
+
43
+ app.Synth(nil)
44
+ }
45
+
46
+ // env determines the AWS environment (account+region) in which our stack is to
47
+ // be deployed. For more information see: https://docs.aws.amazon.com/cdk/latest/guide/environments.html
48
+ func env() *awscdk.Environment {
49
+ // If unspecified, this stack will be "environment-agnostic".
50
+ // Account/Region-dependent features and context lookups will not work, but a
51
+ // single synthesized template can be deployed anywhere.
52
+ //---------------------------------------------------------------------------
53
+ return nil
54
+
55
+ // Uncomment if you know exactly what account and region you want to deploy
56
+ // the stack to. This is the recommendation for production stacks.
57
+ //---------------------------------------------------------------------------
58
+ // return &awscdk.Environment{
59
+ // Account: jsii.String("123456789012"),
60
+ // Region: jsii.String("us-east-1"),
61
+ // }
62
+
63
+ // Uncomment to specialize this stack for the AWS Account and Region that are
64
+ // implied by the current CLI configuration. This is recommended for dev
65
+ // stacks.
66
+ //---------------------------------------------------------------------------
67
+ // return &awscdk.Environment{
68
+ // Account: jsii.String(os.Getenv("CDK_DEFAULT_ACCOUNT")),
69
+ // Region: jsii.String(os.Getenv("CDK_DEFAULT_REGION")),
70
+ // }
71
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/bucket/cdk.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "app": "go mod download && go run bucket.go",
3
+ "watch": {
4
+ "include": [
5
+ "**"
6
+ ],
7
+ "exclude": [
8
+ "README.md",
9
+ "cdk*.json",
10
+ "go.mod",
11
+ "go.sum",
12
+ "**/*test.go"
13
+ ]
14
+ },
15
+ "context": {
16
+ "@aws-cdk/aws-lambda:recognizeLayerVersion": true,
17
+ "@aws-cdk/core:checkSecretUsage": true,
18
+ "@aws-cdk/core:target-partitions": [
19
+ "aws",
20
+ "aws-cn"
21
+ ],
22
+ "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
23
+ "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
24
+ "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
25
+ "@aws-cdk/aws-iam:minimizePolicies": true,
26
+ "@aws-cdk/core:validateSnapshotRemovalPolicy": true,
27
+ "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
28
+ "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
29
+ "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
30
+ "@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
31
+ "@aws-cdk/core:enablePartitionLiterals": true,
32
+ "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
33
+ "@aws-cdk/aws-iam:standardizedServicePrincipals": true,
34
+ "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
35
+ "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
36
+ "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
37
+ "@aws-cdk/aws-route53-patters:useCertificate": true,
38
+ "@aws-cdk/customresources:installLatestAwsSdkDefault": false,
39
+ "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
40
+ "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
41
+ "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
42
+ "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
43
+ "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
44
+ "@aws-cdk/aws-redshift:columnId": true,
45
+ "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
46
+ "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
47
+ "@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
48
+ "@aws-cdk/aws-kms:aliasNameRef": true,
49
+ "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
50
+ "@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
51
+ "@aws-cdk/aws-efs:denyAnonymousAccess": true,
52
+ "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
53
+ "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
54
+ "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
55
+ "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
56
+ "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
57
+ "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true
58
+ }
59
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/bucket/go.mod ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module bucket
2
+
3
+ go 1.18
4
+
5
+ require (
6
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.99.1
7
+ github.com/aws/constructs-go/constructs/v10 v10.2.70
8
+ github.com/aws/jsii-runtime-go v1.88.0
9
+ )
10
+
11
+ require (
12
+ github.com/Masterminds/semver/v3 v3.2.1 // indirect
13
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.200 // indirect
14
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 // indirect
15
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 // indirect
16
+ github.com/fatih/color v1.15.0 // indirect
17
+ github.com/mattn/go-colorable v0.1.13 // indirect
18
+ github.com/mattn/go-isatty v0.0.19 // indirect
19
+ github.com/yuin/goldmark v1.4.13 // indirect
20
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
21
+ golang.org/x/mod v0.12.0 // indirect
22
+ golang.org/x/sys v0.11.0 // indirect
23
+ golang.org/x/tools v0.12.0 // indirect
24
+ )
human_reference_dataset/iac-model-evaluation/cdk/go/bucket/go.sum ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
2
+ github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
3
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.99.1 h1:LMylgq8taW3Lh6GIdtqwAZhmakMIt7roFEJN5DxwFEc=
4
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.99.1/go.mod h1:0HMIUTNhy228wx8J/O5sHPCE+yWP0kiomWjmCctSnRY=
5
+ github.com/aws/constructs-go/constructs/v10 v10.2.70 h1:CuKeOwf27CzGUt8XxOZStFSOVZ7An5XpCzxvqUk8zW4=
6
+ github.com/aws/constructs-go/constructs/v10 v10.2.70/go.mod h1:Jnh2jtqYQBjifA5+03aJmnIItEcjqAgMBJ8iZpFjNRE=
7
+ github.com/aws/jsii-runtime-go v1.88.0 h1:1qJ9Ane+oxTt1c3xkpDE5YIv53MzKDKYcAr70lAxT/Q=
8
+ github.com/aws/jsii-runtime-go v1.88.0/go.mod h1:rIisDqmDOviluOfibmnvjr1I9u2EFcbWLWUjOXy9/Ms=
9
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.200 h1:CwkS78cin4h5A3IaDcL69GrBI1HgTEB/xtECTf1luCc=
10
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.200/go.mod h1:sx6+u9s3UHyhm9BGrkGdQgNA0Ni5ekbJ9hW2Gupvoy0=
11
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 h1:k+WD+6cERd59Mao84v0QtRrcdZuuSMfzlEmuIypKnVs=
12
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2/go.mod h1:CvFHBo0qcg8LUkJqIxQtP1rD/sNGv9bX3L2vHT2FUAo=
13
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 h1:MBBQNKKPJ5GArbctgwpiCy7KmwGjHDjUUH5wEzwIq8w=
14
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1/go.mod h1:/2WiXEft9s8ViJjD01CJqDuyJ8HXBjhBLtK5OvJfdSc=
15
+ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
16
+ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
17
+ github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
18
+ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
19
+ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
20
+ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
21
+ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
22
+ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
23
+ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
24
+ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
25
+ github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
26
+ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
27
+ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
28
+ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
29
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
30
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
31
+ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
32
+ golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
33
+ golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
34
+ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
35
+ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
36
+ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
37
+ golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
38
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
39
+ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
40
+ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
41
+ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
42
+ golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
43
+ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
44
+ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
45
+ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
46
+ golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss=
47
+ golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
48
+ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
49
+ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/.gitignore ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Binaries for programs and plugins
2
+ *.exe
3
+ *.exe~
4
+ *.dll
5
+ *.so
6
+ *.dylib
7
+
8
+ # Test binary, built with `go test -c`
9
+ *.test
10
+
11
+ # Output of the go coverage tool, specifically when used with LiteIDE
12
+ *.out
13
+
14
+ # go.sum should be committed
15
+ !go.sum
16
+
17
+ # CDK asset staging directory
18
+ .cdk.staging
19
+ cdk.out
human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to your CDK Go project!
2
+
3
+ This is a project for CDK development with Go that creates a Cloudfront Distribution.
4
+
5
+ The `cdk.json` file tells the CDK toolkit how to execute your app.
6
+
7
+ ## Useful commands
8
+
9
+ * `cdk deploy` deploy this stack to your default AWS account/region
10
+ * `cdk diff` compare deployed stack with current state
11
+ * `cdk synth` emits the synthesized CloudFormation template
12
+ * `go test` run unit tests
human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/cdk.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "app": "go mod download && go run cloudfront.go",
3
+ "watch": {
4
+ "include": [
5
+ "**"
6
+ ],
7
+ "exclude": [
8
+ "README.md",
9
+ "cdk*.json",
10
+ "go.mod",
11
+ "go.sum",
12
+ "**/*test.go"
13
+ ]
14
+ },
15
+ "context": {
16
+ "@aws-cdk/aws-lambda:recognizeLayerVersion": true,
17
+ "@aws-cdk/core:checkSecretUsage": true,
18
+ "@aws-cdk/core:target-partitions": [
19
+ "aws",
20
+ "aws-cn"
21
+ ],
22
+ "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
23
+ "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
24
+ "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
25
+ "@aws-cdk/aws-iam:minimizePolicies": true,
26
+ "@aws-cdk/core:validateSnapshotRemovalPolicy": true,
27
+ "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
28
+ "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
29
+ "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
30
+ "@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
31
+ "@aws-cdk/core:enablePartitionLiterals": true,
32
+ "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
33
+ "@aws-cdk/aws-iam:standardizedServicePrincipals": true,
34
+ "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
35
+ "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
36
+ "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
37
+ "@aws-cdk/aws-route53-patters:useCertificate": true,
38
+ "@aws-cdk/customresources:installLatestAwsSdkDefault": false,
39
+ "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
40
+ "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
41
+ "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
42
+ "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
43
+ "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
44
+ "@aws-cdk/aws-redshift:columnId": true,
45
+ "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
46
+ "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
47
+ "@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
48
+ "@aws-cdk/aws-kms:aliasNameRef": true,
49
+ "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
50
+ "@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
51
+ "@aws-cdk/aws-efs:denyAnonymousAccess": true,
52
+ "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
53
+ "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
54
+ "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
55
+ "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
56
+ "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
57
+ "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
58
+ "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
59
+ "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true,
60
+ "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true
61
+ }
62
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/cloudfront.go ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ import (
4
+ awscdk "github.com/aws/aws-cdk-go/awscdk/v2"
5
+ cloudfront "github.com/aws/aws-cdk-go/awscdk/v2/awscloudfront"
6
+ origins "github.com/aws/aws-cdk-go/awscdk/v2/awscloudfrontorigins"
7
+ s3 "github.com/aws/aws-cdk-go/awscdk/v2/awss3"
8
+ constructs "github.com/aws/constructs-go/constructs/v10"
9
+ jsii "github.com/aws/jsii-runtime-go"
10
+ )
11
+
12
+ type CloudfrontStackProps struct {
13
+ awscdk.StackProps
14
+ }
15
+
16
+ // Creates a stack that will be used as the parent stack for the Cloudfront distribution.
17
+ func NewCloudfrontStack(scope constructs.Construct, id string, props *CloudfrontStackProps) awscdk.Stack {
18
+ var sprops awscdk.StackProps
19
+ if props != nil {
20
+ sprops = props.StackProps
21
+ }
22
+ // Creates a stack that will be used as the parent stack for the Cloudfront distribution.
23
+ stack := awscdk.NewStack(scope, &id, &sprops)
24
+
25
+ // Creates a S3 bucket that will be used as the origin.
26
+ bucket := s3.NewBucket(stack, jsii.String("mybucket"), &s3.BucketProps{
27
+ RemovalPolicy: awscdk.RemovalPolicy_DESTROY,
28
+ Versioned: jsii.Bool(false),
29
+ })
30
+
31
+ // Creates a Cloudfront distribution that uses the S3 bucket as its origin.
32
+ // Has logging configured to S3.
33
+ distribution := cloudfront.NewDistribution(stack, jsii.String("mydistribution"), &cloudfront.DistributionProps{
34
+ DefaultBehavior: &cloudfront.BehaviorOptions{
35
+ Origin: origins.NewS3Origin(bucket, &origins.S3OriginProps{
36
+ OriginPath: jsii.String("/mywebsite"),
37
+ }),
38
+ },
39
+ EnableLogging: jsii.Bool(true),
40
+ LogBucket: s3.NewBucket(stack, jsii.String("LogBucket"), &s3.BucketProps{
41
+ ObjectOwnership: s3.ObjectOwnership_OBJECT_WRITER,
42
+ }),
43
+ LogFilePrefix: jsii.String("distribution-access-logs/"),
44
+ LogIncludesCookies: jsii.Bool(true),
45
+ })
46
+
47
+ // Creates an output that will be used to access the Cloudfront distribution domain name.
48
+ awscdk.NewCfnOutput(stack, jsii.String("myoutput"), &awscdk.CfnOutputProps{
49
+ Value: distribution.DistributionDomainName(),
50
+ ExportName: jsii.String("myoutput"),
51
+ })
52
+
53
+ return stack
54
+ }
55
+
56
+ func main() {
57
+ app := awscdk.NewApp(nil)
58
+
59
+ NewCloudfrontStack(app, "CloudfrontStack", &CloudfrontStackProps{
60
+ awscdk.StackProps{
61
+ Env: env(),
62
+ },
63
+ })
64
+
65
+ app.Synth(nil)
66
+ }
67
+
68
+ func env() *awscdk.Environment {
69
+ return nil
70
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/cloudfront_test.go ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ // import (
4
+ // "testing"
5
+
6
+ // "github.com/aws/aws-cdk-go/awscdk/v2"
7
+ // "github.com/aws/aws-cdk-go/awscdk/v2/assertions"
8
+ // "github.com/aws/jsii-runtime-go"
9
+ // )
10
+
11
+ // example tests. To run these tests, uncomment this file along with the
12
+ // example resource in cloudfront_test.go
13
+ // func TestCloudfrontStack(t *testing.T) {
14
+ // // GIVEN
15
+ // app := awscdk.NewApp(nil)
16
+
17
+ // // WHEN
18
+ // stack := NewCloudfrontStack(app, "MyStack", nil)
19
+
20
+ // // THEN
21
+ // template := assertions.Template_FromStack(stack, nil)
22
+
23
+ // template.HasResourceProperties(jsii.String("AWS::SQS::Queue"), map[string]interface{}{
24
+ // "VisibilityTimeout": 300,
25
+ // })
26
+ // }
human_reference_dataset/iac-model-evaluation/cdk/go/cloudfront/go.mod ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module cloudfront
2
+
3
+ go 1.18
4
+
5
+ require (
6
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.131.0
7
+ github.com/aws/constructs-go/constructs/v10 v10.3.0
8
+ github.com/aws/jsii-runtime-go v1.94.0
9
+ )
10
+
11
+ require (
12
+ github.com/Masterminds/semver/v3 v3.2.1 // indirect
13
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 // indirect
14
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 // indirect
15
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 // indirect
16
+ github.com/fatih/color v1.16.0 // indirect
17
+ github.com/mattn/go-colorable v0.1.13 // indirect
18
+ github.com/mattn/go-isatty v0.0.20 // indirect
19
+ github.com/yuin/goldmark v1.4.13 // indirect
20
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
21
+ golang.org/x/mod v0.14.0 // indirect
22
+ golang.org/x/sys v0.14.0 // indirect
23
+ golang.org/x/tools v0.16.1 // indirect
24
+ )
human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/.gitignore ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Binaries for programs and plugins
2
+ *.exe
3
+ *.exe~
4
+ *.dll
5
+ *.so
6
+ *.dylib
7
+
8
+ # Test binary, built with `go test -c`
9
+ *.test
10
+
11
+ # Output of the go coverage tool, specifically when used with LiteIDE
12
+ *.out
13
+
14
+ # go.sum should be committed
15
+ !go.sum
16
+
17
+ # CDK asset staging directory
18
+ .cdk.staging
19
+ cdk.out
human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to your CDK Go project!
2
+
3
+ This is a blank project for CDK development with Go.
4
+
5
+ The `cdk.json` file tells the CDK toolkit how to execute your app.
6
+
7
+ ## Useful commands
8
+
9
+ * `cdk deploy` deploy this stack to your default AWS account/region
10
+ * `cdk diff` compare deployed stack with current state
11
+ * `cdk synth` emits the synthesized CloudFormation template
12
+ * `go test` run unit tests
human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/cdk.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "app": "go mod download && go run dynamodb_table.go",
3
+ "watch": {
4
+ "include": [
5
+ "**"
6
+ ],
7
+ "exclude": [
8
+ "README.md",
9
+ "cdk*.json",
10
+ "go.mod",
11
+ "go.sum",
12
+ "**/*test.go"
13
+ ]
14
+ },
15
+ "context": {
16
+ "@aws-cdk/aws-lambda:recognizeLayerVersion": true,
17
+ "@aws-cdk/core:checkSecretUsage": true,
18
+ "@aws-cdk/core:target-partitions": [
19
+ "aws",
20
+ "aws-cn"
21
+ ],
22
+ "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
23
+ "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
24
+ "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
25
+ "@aws-cdk/aws-iam:minimizePolicies": true,
26
+ "@aws-cdk/core:validateSnapshotRemovalPolicy": true,
27
+ "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
28
+ "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
29
+ "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
30
+ "@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
31
+ "@aws-cdk/core:enablePartitionLiterals": true,
32
+ "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
33
+ "@aws-cdk/aws-iam:standardizedServicePrincipals": true,
34
+ "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
35
+ "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
36
+ "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
37
+ "@aws-cdk/aws-route53-patters:useCertificate": true,
38
+ "@aws-cdk/customresources:installLatestAwsSdkDefault": false,
39
+ "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
40
+ "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
41
+ "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
42
+ "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
43
+ "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
44
+ "@aws-cdk/aws-redshift:columnId": true,
45
+ "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
46
+ "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
47
+ "@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
48
+ "@aws-cdk/aws-kms:aliasNameRef": true,
49
+ "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
50
+ "@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
51
+ "@aws-cdk/aws-efs:denyAnonymousAccess": true,
52
+ "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
53
+ "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
54
+ "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
55
+ "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
56
+ "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
57
+ "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
58
+ "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
59
+ "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true,
60
+ "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true
61
+ }
62
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/dynamodb_table.go ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ import (
4
+ "github.com/aws/aws-cdk-go/awscdk/v2"
5
+ "github.com/aws/aws-cdk-go/awscdk/v2/awsdynamodb"
6
+ "github.com/aws/constructs-go/constructs/v10"
7
+ "github.com/aws/jsii-runtime-go"
8
+ )
9
+
10
+ type DynamodbTableStackProps struct {
11
+ awscdk.StackProps
12
+ }
13
+
14
+ func NewDynamodbTableStack(scope constructs.Construct, id string, props *DynamodbTableStackProps) awscdk.Stack {
15
+ var sprops awscdk.StackProps
16
+ if props != nil {
17
+ sprops = props.StackProps
18
+ }
19
+ stack := awscdk.NewStack(scope, &id, &sprops)
20
+
21
+ // create dynamo db table
22
+ awsdynamodb.NewTable(stack, jsii.String("MyTable"), &awsdynamodb.TableProps{
23
+ PartitionKey: &awsdynamodb.Attribute{
24
+ Name: jsii.String("id"),
25
+ Type: awsdynamodb.AttributeType_STRING,
26
+ },
27
+ BillingMode: awsdynamodb.BillingMode_PAY_PER_REQUEST,
28
+ })
29
+
30
+ return stack
31
+ }
32
+
33
+ func main() {
34
+ defer jsii.Close()
35
+
36
+ app := awscdk.NewApp(nil)
37
+
38
+ NewDynamodbTableStack(app, "DynamodbTableStack", &DynamodbTableStackProps{
39
+ awscdk.StackProps{
40
+ Env: env(),
41
+ },
42
+ })
43
+
44
+ app.Synth(nil)
45
+ }
46
+
47
+ // env determines the AWS environment (account+region) in which our stack is to
48
+ // be deployed. For more information see: https://docs.aws.amazon.com/cdk/latest/guide/environments.html
49
+ func env() *awscdk.Environment {
50
+ // If unspecified, this stack will be "environment-agnostic".
51
+ // Account/Region-dependent features and context lookups will not work, but a
52
+ // single synthesized template can be deployed anywhere.
53
+ //---------------------------------------------------------------------------
54
+ return nil
55
+
56
+ // Uncomment if you know exactly what account and region you want to deploy
57
+ // the stack to. This is the recommendation for production stacks.
58
+ //---------------------------------------------------------------------------
59
+ // return &awscdk.Environment{
60
+ // Account: jsii.String("123456789012"),
61
+ // Region: jsii.String("us-east-1"),
62
+ // }
63
+
64
+ // Uncomment to specialize this stack for the AWS Account and Region that are
65
+ // implied by the current CLI configuration. This is recommended for dev
66
+ // stacks.
67
+ //---------------------------------------------------------------------------
68
+ // return &awscdk.Environment{
69
+ // Account: jsii.String(os.Getenv("CDK_DEFAULT_ACCOUNT")),
70
+ // Region: jsii.String(os.Getenv("CDK_DEFAULT_REGION")),
71
+ // }
72
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/dynamodb_table_test.go ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ // import (
4
+ // "testing"
5
+
6
+ // "github.com/aws/aws-cdk-go/awscdk/v2"
7
+ // "github.com/aws/aws-cdk-go/awscdk/v2/assertions"
8
+ // "github.com/aws/jsii-runtime-go"
9
+ // )
10
+
11
+ // example tests. To run these tests, uncomment this file along with the
12
+ // example resource in dynamodb_table_test.go
13
+ // func TestDynamodbTableStack(t *testing.T) {
14
+ // // GIVEN
15
+ // app := awscdk.NewApp(nil)
16
+
17
+ // // WHEN
18
+ // stack := NewDynamodbTableStack(app, "MyStack", nil)
19
+
20
+ // // THEN
21
+ // template := assertions.Template_FromStack(stack, nil)
22
+
23
+ // template.HasResourceProperties(jsii.String("AWS::SQS::Queue"), map[string]interface{}{
24
+ // "VisibilityTimeout": 300,
25
+ // })
26
+ // }
human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/go.mod ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module dynamodb_table
2
+
3
+ go 1.18
4
+
5
+ require (
6
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.127.0
7
+ github.com/aws/constructs-go/constructs/v10 v10.3.0
8
+ github.com/aws/jsii-runtime-go v1.94.0
9
+ )
10
+
11
+ require (
12
+ github.com/Masterminds/semver/v3 v3.2.1 // indirect
13
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 // indirect
14
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 // indirect
15
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 // indirect
16
+ github.com/fatih/color v1.16.0 // indirect
17
+ github.com/mattn/go-colorable v0.1.13 // indirect
18
+ github.com/mattn/go-isatty v0.0.20 // indirect
19
+ github.com/yuin/goldmark v1.4.13 // indirect
20
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
21
+ golang.org/x/mod v0.14.0 // indirect
22
+ golang.org/x/sys v0.14.0 // indirect
23
+ golang.org/x/tools v0.16.1 // indirect
24
+ )
human_reference_dataset/iac-model-evaluation/cdk/go/dynamodb_table/go.sum ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
2
+ github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
3
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.127.0 h1:toQoTegbYFa36s2LFkr1LDA5oLy/aC4nRpAMbof0foc=
4
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.127.0/go.mod h1:TpmJwOnoajvRtwnLlJoxEoppb9sVoCLfPGLdgoTDH7o=
5
+ github.com/aws/constructs-go/constructs/v10 v10.3.0 h1:LsjBIMiaDX/vqrXWhzTquBJ9pPdi02/H+z1DCwg0PEM=
6
+ github.com/aws/constructs-go/constructs/v10 v10.3.0/go.mod h1:GgzwIwoRJ2UYsr3SU+JhAl+gq5j39bEMYf8ev3J+s9s=
7
+ github.com/aws/jsii-runtime-go v1.94.0 h1:VuVDx0xL2gbsJthUMfP+SwAXGkSEQd0GKm0ydZ8xga8=
8
+ github.com/aws/jsii-runtime-go v1.94.0/go.mod h1:tQOz8aAMzM2XsRUDsnUgPvGcHNAzR/xtH0OgeM0lTWo=
9
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 h1:VixXB9DnHN8oP7pXipq8GVFPjWCOdeNxIaS/ZyUwTkI=
10
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202/go.mod h1:iPUti/SWjA3XAS3CpnLciFjS8TN9Y+8mdZgDfSgcyus=
11
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 h1:k+WD+6cERd59Mao84v0QtRrcdZuuSMfzlEmuIypKnVs=
12
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2/go.mod h1:CvFHBo0qcg8LUkJqIxQtP1rD/sNGv9bX3L2vHT2FUAo=
13
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 h1:MBBQNKKPJ5GArbctgwpiCy7KmwGjHDjUUH5wEzwIq8w=
14
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1/go.mod h1:/2WiXEft9s8ViJjD01CJqDuyJ8HXBjhBLtK5OvJfdSc=
15
+ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
16
+ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
17
+ github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
18
+ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
19
+ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
20
+ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
21
+ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
22
+ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
23
+ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
24
+ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
25
+ github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
26
+ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
27
+ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
28
+ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
29
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
30
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
31
+ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
32
+ golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
33
+ golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
34
+ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
35
+ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
36
+ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
37
+ golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
38
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
39
+ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
40
+ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
41
+ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
42
+ golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
43
+ golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
44
+ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
45
+ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
46
+ golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA=
47
+ golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
48
+ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
49
+ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
human_reference_dataset/iac-model-evaluation/cdk/go/ec2/.gitignore ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Binaries for programs and plugins
2
+ *.exe
3
+ *.exe~
4
+ *.dll
5
+ *.so
6
+ *.dylib
7
+
8
+ # Test binary, built with `go test -c`
9
+ *.test
10
+
11
+ # Output of the go coverage tool, specifically when used with LiteIDE
12
+ *.out
13
+
14
+ # go.sum should be committed
15
+ !go.sum
16
+
17
+ # CDK asset staging directory
18
+ .cdk.staging
19
+ cdk.out
human_reference_dataset/iac-model-evaluation/cdk/go/ec2/README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to a CDK Go project that deploys an EC2 instance!
2
+
3
+ This deploys the following:
4
+ - EC2 Instancecr
5
+ - Security Group
6
+ - VPC
7
+
8
+ This is a blank project for CDK development with Go.
9
+
10
+ The `cdk.json` file tells the CDK toolkit how to execute your app.
11
+
12
+ ## Useful commands
13
+
14
+ * `cdk deploy` deploy this stack to your default AWS account/region
15
+ * `cdk diff` compare deployed stack with current state
16
+ * `cdk synth` emits the synthesized CloudFormation template
17
+ * `go test` run unit tests
human_reference_dataset/iac-model-evaluation/cdk/go/ec2/cdk.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "app": "go mod download && go run ec2.go",
3
+ "watch": {
4
+ "include": [
5
+ "**"
6
+ ],
7
+ "exclude": [
8
+ "README.md",
9
+ "cdk*.json",
10
+ "go.mod",
11
+ "go.sum",
12
+ "**/*test.go"
13
+ ]
14
+ },
15
+ "context": {
16
+ "@aws-cdk/aws-lambda:recognizeLayerVersion": true,
17
+ "@aws-cdk/core:checkSecretUsage": true,
18
+ "@aws-cdk/core:target-partitions": [
19
+ "aws",
20
+ "aws-cn"
21
+ ],
22
+ "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
23
+ "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
24
+ "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
25
+ "@aws-cdk/aws-iam:minimizePolicies": true,
26
+ "@aws-cdk/core:validateSnapshotRemovalPolicy": true,
27
+ "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
28
+ "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
29
+ "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
30
+ "@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
31
+ "@aws-cdk/core:enablePartitionLiterals": true,
32
+ "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
33
+ "@aws-cdk/aws-iam:standardizedServicePrincipals": true,
34
+ "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
35
+ "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
36
+ "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
37
+ "@aws-cdk/aws-route53-patters:useCertificate": true,
38
+ "@aws-cdk/customresources:installLatestAwsSdkDefault": false,
39
+ "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
40
+ "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
41
+ "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
42
+ "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
43
+ "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
44
+ "@aws-cdk/aws-redshift:columnId": true,
45
+ "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
46
+ "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
47
+ "@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
48
+ "@aws-cdk/aws-kms:aliasNameRef": true,
49
+ "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
50
+ "@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
51
+ "@aws-cdk/aws-efs:denyAnonymousAccess": true,
52
+ "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
53
+ "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
54
+ "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
55
+ "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
56
+ "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
57
+ "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
58
+ "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true
59
+ }
60
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/ec2/ec2.go ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ import (
4
+ awscdk "github.com/aws/aws-cdk-go/awscdk/v2"
5
+ awsec2 "github.com/aws/aws-cdk-go/awscdk/v2/awsec2"
6
+ awsiam "github.com/aws/aws-cdk-go/awscdk/v2/awsiam"
7
+ constructs "github.com/aws/constructs-go/constructs/v10"
8
+ jsii "github.com/aws/jsii-runtime-go"
9
+ )
10
+
11
+ type Ec2StackProps struct {
12
+ awscdk.StackProps
13
+ }
14
+
15
+ func NewEc2Stack(scope constructs.Construct, id string, props *Ec2StackProps) awscdk.Stack {
16
+ var sprops awscdk.StackProps
17
+ if props != nil {
18
+ sprops = props.StackProps
19
+ }
20
+ stack := awscdk.NewStack(scope, &id, &sprops)
21
+
22
+ vpc := awsec2.NewVpc(stack, jsii.String("Vpc"), nil)
23
+
24
+ sg := awsec2.NewSecurityGroup(stack, jsii.String("SecurityGroup"), &awsec2.SecurityGroupProps{
25
+ Vpc: vpc,
26
+ AllowAllOutbound: jsii.Bool(true),
27
+ Description: jsii.String("Instance Security Group"),
28
+ })
29
+
30
+ sg.AddIngressRule(awsec2.Peer_AnyIpv4(), awsec2.NewPort(&awsec2.PortProps{
31
+ Protocol: awsec2.Protocol_TCP,
32
+ FromPort: jsii.Number(22),
33
+ ToPort: jsii.Number(22),
34
+ StringRepresentation: jsii.String("SSH"),
35
+ }),
36
+ jsii.String("Allow SSH (TCP port 22) in"),
37
+ jsii.Bool(false),
38
+ )
39
+
40
+ sg.AddIngressRule(awsec2.Peer_AnyIpv4(), awsec2.NewPort(&awsec2.PortProps{
41
+ Protocol: awsec2.Protocol_TCP,
42
+ FromPort: jsii.Number(80),
43
+ ToPort: jsii.Number(80),
44
+ StringRepresentation: jsii.String("HTTP"),
45
+ }),
46
+ jsii.String("Allow HTTP (TCP port 80) in"),
47
+ jsii.Bool(false),
48
+ )
49
+
50
+ role := awsiam.NewRole(stack, jsii.String("Role"), &awsiam.RoleProps{
51
+ AssumedBy: awsiam.NewServicePrincipal(jsii.String("ec2.amazonaws.com"), nil),
52
+ Description: jsii.String("Instance Role"),
53
+ ManagedPolicies: &[]awsiam.IManagedPolicy{
54
+ awsiam.ManagedPolicy_FromAwsManagedPolicyName(jsii.String("AmazonSSMManagedInstanceCore")),
55
+ awsiam.ManagedPolicy_FromAwsManagedPolicyName(jsii.String("CloudWatchAgentServerPolicy")),
56
+ },
57
+ })
58
+
59
+ role.AddManagedPolicy(awsiam.ManagedPolicy_FromAwsManagedPolicyName(jsii.String("AmazonSSMManagedInstanceCore")))
60
+
61
+ instance := awsec2.NewInstance(stack, jsii.String("Ec2Instance"), &awsec2.InstanceProps{
62
+ Vpc: vpc,
63
+ InstanceType: awsec2.NewInstanceType(jsii.String("t2.micro")),
64
+ MachineImage: awsec2.NewAmazonLinuxImage(&awsec2.AmazonLinuxImageProps{
65
+ Generation: awsec2.AmazonLinuxGeneration(awsec2.AmazonLinuxGeneration_AMAZON_LINUX_2),
66
+ }),
67
+ SecurityGroup: sg,
68
+ Role: role,
69
+ })
70
+
71
+ instance.AddUserData(jsii.String("yum update -y"), jsii.String("yum install -y httpd"), jsii.String("systemctl start httpd"), jsii.String("systemctl enable httpd"),
72
+ jsii.String("echo \"<html><body><h1>Hello World from $(hostname -f)</h1></body></html>\" > /var/www/html/index.html"))
73
+
74
+ return stack
75
+ }
76
+
77
+ func main() {
78
+ defer jsii.Close()
79
+
80
+ app := awscdk.NewApp(nil)
81
+
82
+ NewEc2Stack(app, "Ec2Stack", &Ec2StackProps{
83
+ awscdk.StackProps{
84
+ Env: env(),
85
+ },
86
+ })
87
+
88
+ app.Synth(nil)
89
+ }
90
+
91
+ // env determines the AWS environment (account+region) in which our stack is to
92
+ // be deployed. For more information see: https://docs.aws.amazon.com/cdk/latest/guide/environments.html
93
+ func env() *awscdk.Environment {
94
+ // If unspecified, this stack will be "environment-agnostic".
95
+ // Account/Region-dependent features and context lookups will not work, but a
96
+ // single synthesized template can be deployed anywhere.
97
+ //---------------------------------------------------------------------------
98
+ return nil
99
+
100
+ // Uncomment if you know exactly what account and region you want to deploy
101
+ // the stack to. This is the recommendation for production stacks.
102
+ //---------------------------------------------------------------------------
103
+ // return &awscdk.Environment{
104
+ // Account: jsii.String("123456789012"),
105
+ // Region: jsii.String("us-east-1"),
106
+ // }
107
+
108
+ // Uncomment to specialize this stack for the AWS Account and Region that are
109
+ // implied by the current CLI configuration. This is recommended for dev
110
+ // stacks.
111
+ //---------------------------------------------------------------------------
112
+ // return &awscdk.Environment{
113
+ // Account: jsii.String(os.Getenv("CDK_DEFAULT_ACCOUNT")),
114
+ // Region: jsii.String(os.Getenv("CDK_DEFAULT_REGION")),
115
+ // }
116
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/ec2/ec2_test.go ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ // import (
4
+ // "testing"
5
+
6
+ // "github.com/aws/aws-cdk-go/awscdk/v2"
7
+ // "github.com/aws/aws-cdk-go/awscdk/v2/assertions"
8
+ // "github.com/aws/jsii-runtime-go"
9
+ // )
10
+
11
+ // example tests. To run these tests, uncomment this file along with the
12
+ // example resource in ec2_test.go
13
+ // func TestEc2Stack(t *testing.T) {
14
+ // // GIVEN
15
+ // app := awscdk.NewApp(nil)
16
+
17
+ // // WHEN
18
+ // stack := NewEc2Stack(app, "MyStack", nil)
19
+
20
+ // // THEN
21
+ // template := assertions.Template_FromStack(stack, nil)
22
+
23
+ // template.HasResourceProperties(jsii.String("AWS::SQS::Queue"), map[string]interface{}{
24
+ // "VisibilityTimeout": 300,
25
+ // })
26
+ // }
human_reference_dataset/iac-model-evaluation/cdk/go/ec2/go.mod ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module ec2
2
+
3
+ go 1.18
4
+
5
+ require github.com/aws/aws-cdk-go/awscdk/v2 v2.114.1
6
+
7
+ require (
8
+ github.com/Masterminds/semver/v3 v3.2.1 // indirect
9
+ github.com/aws/constructs-go/constructs/v10 v10.3.0 // indirect
10
+ github.com/aws/jsii-runtime-go v1.92.0 // indirect
11
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.201 // indirect
12
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 // indirect
13
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 // indirect
14
+ )
human_reference_dataset/iac-model-evaluation/cdk/go/efs/.gitignore ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Binaries for programs and plugins
2
+ *.exe
3
+ *.exe~
4
+ *.dll
5
+ *.so
6
+ *.dylib
7
+
8
+ # Test binary, built with `go test -c`
9
+ *.test
10
+
11
+ # Output of the go coverage tool, specifically when used with LiteIDE
12
+ *.out
13
+
14
+ # go.sum should be committed
15
+ !go.sum
16
+
17
+ # CDK asset staging directory
18
+ .cdk.staging
19
+ cdk.out
human_reference_dataset/iac-model-evaluation/cdk/go/efs/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to your CDK Go project!
2
+
3
+ This is a blank project for CDK development with Go.
4
+
5
+ The `cdk.json` file tells the CDK toolkit how to execute your app.
6
+
7
+ ## Useful commands
8
+
9
+ * `cdk deploy` deploy this stack to your default AWS account/region
10
+ * `cdk diff` compare deployed stack with current state
11
+ * `cdk synth` emits the synthesized CloudFormation template
12
+ * `go test` run unit tests
human_reference_dataset/iac-model-evaluation/cdk/go/efs/cdk.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "app": "go mod download && go run efs.go",
3
+ "watch": {
4
+ "include": [
5
+ "**"
6
+ ],
7
+ "exclude": [
8
+ "README.md",
9
+ "cdk*.json",
10
+ "go.mod",
11
+ "go.sum",
12
+ "**/*test.go"
13
+ ]
14
+ },
15
+ "context": {
16
+ "@aws-cdk/aws-lambda:recognizeLayerVersion": true,
17
+ "@aws-cdk/core:checkSecretUsage": true,
18
+ "@aws-cdk/core:target-partitions": [
19
+ "aws",
20
+ "aws-cn"
21
+ ],
22
+ "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
23
+ "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
24
+ "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
25
+ "@aws-cdk/aws-iam:minimizePolicies": true,
26
+ "@aws-cdk/core:validateSnapshotRemovalPolicy": true,
27
+ "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
28
+ "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
29
+ "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
30
+ "@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
31
+ "@aws-cdk/core:enablePartitionLiterals": true,
32
+ "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
33
+ "@aws-cdk/aws-iam:standardizedServicePrincipals": true,
34
+ "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
35
+ "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
36
+ "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
37
+ "@aws-cdk/aws-route53-patters:useCertificate": true,
38
+ "@aws-cdk/customresources:installLatestAwsSdkDefault": false,
39
+ "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
40
+ "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
41
+ "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
42
+ "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
43
+ "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
44
+ "@aws-cdk/aws-redshift:columnId": true,
45
+ "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
46
+ "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
47
+ "@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
48
+ "@aws-cdk/aws-kms:aliasNameRef": true,
49
+ "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
50
+ "@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
51
+ "@aws-cdk/aws-efs:denyAnonymousAccess": true,
52
+ "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
53
+ "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
54
+ "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
55
+ "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
56
+ "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
57
+ "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
58
+ "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
59
+ "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true,
60
+ "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true
61
+ }
62
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/efs/efs.go ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ import (
4
+ "github.com/aws/aws-cdk-go/awscdk/v2"
5
+ "github.com/aws/aws-cdk-go/awscdk/v2/awsec2"
6
+ "github.com/aws/aws-cdk-go/awscdk/v2/awsecs"
7
+ "github.com/aws/aws-cdk-go/awscdk/v2/awsefs"
8
+ "github.com/aws/aws-cdk-go/awscdk/v2/awsiam"
9
+ "github.com/aws/aws-cdk-go/awscdk/v2/awskms"
10
+ "github.com/aws/constructs-go/constructs/v10"
11
+ "github.com/aws/jsii-runtime-go"
12
+ )
13
+
14
+ type EfsStackProps struct {
15
+ awscdk.StackProps
16
+ }
17
+
18
+ func NewEfsStack(scope constructs.Construct, id string, props *EfsStackProps) awscdk.Stack {
19
+ var sprops awscdk.StackProps
20
+ if props != nil {
21
+ sprops = props.StackProps
22
+ }
23
+ stack := awscdk.NewStack(scope, &id, &sprops)
24
+
25
+ // Create a KMS Key for EFS encryption
26
+ kmsKey := awskms.NewKey(stack, jsii.String("EfsKmsKey"), &awskms.KeyProps{
27
+ EnableKeyRotation: jsii.Bool(true),
28
+ })
29
+
30
+ // Create a VPC with a CIDR 10.0.0.0/16
31
+ vpc := awsec2.NewVpc(stack, jsii.String("MyVpc"), &awsec2.VpcProps{
32
+ IpAddresses: awsec2.IpAddresses_Cidr(jsii.String("10.0.0.0/16")),
33
+ MaxAzs: jsii.Number(3),
34
+ EnableDnsHostnames: jsii.Bool(true),
35
+ EnableDnsSupport: jsii.Bool(true),
36
+ })
37
+
38
+ // Define EFS security group
39
+ efsSecurityGroup := awsec2.NewSecurityGroup(stack, jsii.String("EfsSecurityGroup"), &awsec2.SecurityGroupProps{
40
+ Vpc: vpc,
41
+ AllowAllOutbound: jsii.Bool(true),
42
+ })
43
+
44
+ // Add inbound rule on port 2049 to allow NFS traffic
45
+ efsSecurityGroup.AddIngressRule(awsec2.Peer_AnyIpv4(), awsec2.Port_Tcp(jsii.Number(2049)), jsii.String("Allow NFS inbound traffic"), jsii.Bool(true))
46
+
47
+ // Create an EFS resource arn and dynamically pass the region and account id
48
+ efsResourceArn := awscdk.Fn_Sub(jsii.String("arn:aws:elasticfilesystem:${AWS::Region}:${AWS::AccountId}:file-system/*"), nil)
49
+
50
+ // Create a policy statement
51
+ statement := awsiam.NewPolicyStatement(&awsiam.PolicyStatementProps{
52
+ Actions: &[]*string{
53
+ jsii.String("elasticfilesystem:ClientWrite"),
54
+ jsii.String("elasticfilesystem:ClientMount"),
55
+ jsii.String("elasticfilesystem:ClientRootAccess"),
56
+ },
57
+ Effect: awsiam.Effect_ALLOW,
58
+ Principals: &[]awsiam.IPrincipal{
59
+ awsiam.NewAnyPrincipal(),
60
+ },
61
+ Resources: &[]*string{
62
+ efsResourceArn,
63
+ },
64
+ })
65
+
66
+ // Add the statement to a policy document
67
+ FileSystemPolicy := awsiam.NewPolicyDocument(&awsiam.PolicyDocumentProps{
68
+ Statements: &[]awsiam.PolicyStatement{statement},
69
+ })
70
+
71
+ // Create an EFS Filesystem
72
+ efsFileSystem := awsefs.NewFileSystem(stack, jsii.String("MyEfsFileSystem"), &awsefs.FileSystemProps{
73
+ Vpc: vpc,
74
+ Encrypted: jsii.Bool(true),
75
+ KmsKey: kmsKey,
76
+ SecurityGroup: efsSecurityGroup,
77
+ FileSystemPolicy: FileSystemPolicy,
78
+ })
79
+
80
+ // Create an ECS Cluster
81
+ ecsCluster := awsecs.NewCluster(stack, jsii.String("MyCluster"), &awsecs.ClusterProps{
82
+ Vpc: vpc,
83
+ })
84
+
85
+ // Create ECS Task Definition
86
+ taskDefinition := awsecs.NewFargateTaskDefinition(stack, jsii.String("MyFargateTask"), &awsecs.FargateTaskDefinitionProps{
87
+ MemoryLimitMiB: jsii.Number(512),
88
+ Cpu: jsii.Number(256),
89
+ })
90
+
91
+ // Define the EFS volume in the task definition
92
+ taskDefinition.AddVolume(&awsecs.Volume{
93
+ Name: jsii.String("MyEfsVolume"),
94
+ EfsVolumeConfiguration: &awsecs.EfsVolumeConfiguration{
95
+ FileSystemId: efsFileSystem.FileSystemId(),
96
+ RootDirectory: jsii.String("/"),
97
+ },
98
+ })
99
+
100
+ // Get task definition role
101
+ taskRole := taskDefinition.TaskRole()
102
+
103
+ // Add elasticfilesystem:ClientMount and elasticfilesystem:ClientWrite permission to the role
104
+ taskRole.AddToPrincipalPolicy(awsiam.NewPolicyStatement(&awsiam.PolicyStatementProps{
105
+ Actions: jsii.Strings("elasticfilesystem:ClientMount", "elasticfilesystem:ClientWrite"),
106
+ Resources: jsii.Strings("*"),
107
+ }))
108
+
109
+ // Add a container to the task definition
110
+ container := taskDefinition.AddContainer(jsii.String("MyContainer"), &awsecs.ContainerDefinitionOptions{
111
+ Image: awsecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample"), nil),
112
+ })
113
+
114
+ // Mount the EFS volume to the container
115
+ container.AddMountPoints(&awsecs.MountPoint{
116
+ SourceVolume: jsii.String("MyEfsVolume"),
117
+ ContainerPath: jsii.String("/mnt/efs"),
118
+ ReadOnly: jsii.Bool(false),
119
+ })
120
+
121
+ // Create Fargate Service
122
+ awsecs.NewFargateService(stack, jsii.String("MyFargateService"), &awsecs.FargateServiceProps{
123
+ Cluster: ecsCluster,
124
+ TaskDefinition: taskDefinition,
125
+ })
126
+
127
+ return stack
128
+ }
129
+
130
+ func main() {
131
+ defer jsii.Close()
132
+
133
+ app := awscdk.NewApp(nil)
134
+
135
+ NewEfsStack(app, "EfsStack", &EfsStackProps{
136
+ awscdk.StackProps{
137
+ Env: env(),
138
+ },
139
+ })
140
+
141
+ app.Synth(nil)
142
+ }
143
+
144
+ // env determines the AWS environment (account+region) in which our stack is to
145
+ // be deployed. For more information see: https://docs.aws.amazon.com/cdk/latest/guide/environments.html
146
+ func env() *awscdk.Environment {
147
+ // If unspecified, this stack will be "environment-agnostic".
148
+ // Account/Region-dependent features and context lookups will not work, but a
149
+ // single synthesized template can be deployed anywhere.
150
+ //---------------------------------------------------------------------------
151
+ return nil
152
+
153
+ // Uncomment if you know exactly what account and region you want to deploy
154
+ // the stack to. This is the recommendation for production stacks.
155
+ //---------------------------------------------------------------------------
156
+ // return &awscdk.Environment{
157
+ // Account: jsii.String("123456789012"),
158
+ // Region: jsii.String("us-east-1"),
159
+ // }
160
+
161
+ // Uncomment to specialize this stack for the AWS Account and Region that are
162
+ // implied by the current CLI configuration. This is recommended for dev
163
+ // stacks.
164
+ //---------------------------------------------------------------------------
165
+ // return &awscdk.Environment{
166
+ // Account: jsii.String(os.Getenv("CDK_DEFAULT_ACCOUNT")),
167
+ // Region: jsii.String(os.Getenv("CDK_DEFAULT_REGION")),
168
+ // }
169
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/efs/efs_test.go ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ // import (
4
+ // "testing"
5
+
6
+ // "github.com/aws/aws-cdk-go/awscdk/v2"
7
+ // "github.com/aws/aws-cdk-go/awscdk/v2/assertions"
8
+ // "github.com/aws/jsii-runtime-go"
9
+ // )
10
+
11
+ // example tests. To run these tests, uncomment this file along with the
12
+ // example resource in efs_test.go
13
+ // func TestEfsStack(t *testing.T) {
14
+ // // GIVEN
15
+ // app := awscdk.NewApp(nil)
16
+
17
+ // // WHEN
18
+ // stack := NewEfsStack(app, "MyStack", nil)
19
+
20
+ // // THEN
21
+ // template := assertions.Template_FromStack(stack, nil)
22
+
23
+ // template.HasResourceProperties(jsii.String("AWS::SQS::Queue"), map[string]interface{}{
24
+ // "VisibilityTimeout": 300,
25
+ // })
26
+ // }
human_reference_dataset/iac-model-evaluation/cdk/go/efs/go.mod ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module efs
2
+
3
+ go 1.18
4
+
5
+ require (
6
+ github.com/aws/aws-cdk-go/awscdk v1.204.0-devpreview
7
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.127.0
8
+ github.com/aws/constructs-go/constructs/v10 v10.3.0
9
+ github.com/aws/jsii-runtime-go v1.94.0
10
+ )
11
+
12
+ require (
13
+ github.com/Masterminds/semver/v3 v3.2.1 // indirect
14
+ github.com/aws/constructs-go/constructs/v3 v3.4.232 // indirect
15
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 // indirect
16
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 // indirect
17
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 // indirect
18
+ github.com/fatih/color v1.16.0 // indirect
19
+ github.com/mattn/go-colorable v0.1.13 // indirect
20
+ github.com/mattn/go-isatty v0.0.20 // indirect
21
+ github.com/yuin/goldmark v1.4.13 // indirect
22
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
23
+ golang.org/x/mod v0.14.0 // indirect
24
+ golang.org/x/sys v0.14.0 // indirect
25
+ golang.org/x/tools v0.16.1 // indirect
26
+ )
human_reference_dataset/iac-model-evaluation/cdk/go/efs/go.sum ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
2
+ github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
3
+ github.com/aws/aws-cdk-go/awscdk v1.204.0-devpreview h1:t3TI4mtmRQlUF5OceL3zhhTlz1RtFMMbsWQ1oMrAsWg=
4
+ github.com/aws/aws-cdk-go/awscdk v1.204.0-devpreview/go.mod h1:ZAyiU+hVHfDS6Vvxf1ljmwawmA5Ri6FUay6M04+93pk=
5
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.127.0 h1:toQoTegbYFa36s2LFkr1LDA5oLy/aC4nRpAMbof0foc=
6
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.127.0/go.mod h1:TpmJwOnoajvRtwnLlJoxEoppb9sVoCLfPGLdgoTDH7o=
7
+ github.com/aws/constructs-go/constructs/v10 v10.3.0 h1:LsjBIMiaDX/vqrXWhzTquBJ9pPdi02/H+z1DCwg0PEM=
8
+ github.com/aws/constructs-go/constructs/v10 v10.3.0/go.mod h1:GgzwIwoRJ2UYsr3SU+JhAl+gq5j39bEMYf8ev3J+s9s=
9
+ github.com/aws/constructs-go/constructs/v3 v3.4.232 h1:YLw1wSu8/qqmacsZWPXI+qFNu4ml2YZwtRZHL2gaB8M=
10
+ github.com/aws/constructs-go/constructs/v3 v3.4.232/go.mod h1:ejR5Hd2llgfqo68taM7H/hnri4hrHObbsqbT6YySLMI=
11
+ github.com/aws/jsii-runtime-go v1.94.0 h1:VuVDx0xL2gbsJthUMfP+SwAXGkSEQd0GKm0ydZ8xga8=
12
+ github.com/aws/jsii-runtime-go v1.94.0/go.mod h1:tQOz8aAMzM2XsRUDsnUgPvGcHNAzR/xtH0OgeM0lTWo=
13
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 h1:VixXB9DnHN8oP7pXipq8GVFPjWCOdeNxIaS/ZyUwTkI=
14
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202/go.mod h1:iPUti/SWjA3XAS3CpnLciFjS8TN9Y+8mdZgDfSgcyus=
15
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 h1:k+WD+6cERd59Mao84v0QtRrcdZuuSMfzlEmuIypKnVs=
16
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2/go.mod h1:CvFHBo0qcg8LUkJqIxQtP1rD/sNGv9bX3L2vHT2FUAo=
17
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 h1:MBBQNKKPJ5GArbctgwpiCy7KmwGjHDjUUH5wEzwIq8w=
18
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1/go.mod h1:/2WiXEft9s8ViJjD01CJqDuyJ8HXBjhBLtK5OvJfdSc=
19
+ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
20
+ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
21
+ github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
22
+ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
23
+ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
24
+ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
25
+ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
26
+ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
27
+ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
28
+ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
29
+ github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
30
+ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
31
+ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
32
+ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
33
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
34
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
35
+ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
36
+ golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
37
+ golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
38
+ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
39
+ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
40
+ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
41
+ golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
42
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
43
+ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
44
+ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
45
+ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
46
+ golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
47
+ golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
48
+ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
49
+ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
50
+ golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA=
51
+ golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
52
+ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
53
+ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/.gitignore ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Binaries for programs and plugins
2
+ *.exe
3
+ *.exe~
4
+ *.dll
5
+ *.so
6
+ *.dylib
7
+
8
+ # Test binary, built with `go test -c`
9
+ *.test
10
+
11
+ # Output of the go coverage tool, specifically when used with LiteIDE
12
+ *.out
13
+
14
+ # go.sum should be committed
15
+ !go.sum
16
+
17
+ # CDK asset staging directory
18
+ .cdk.staging
19
+ cdk.out
human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to your CDK Go project!
2
+
3
+ This is a project for CDK development with Go that builds a Kinesis stream.
4
+
5
+ The `cdk.json` file tells the CDK toolkit how to execute your app.
6
+
7
+ ## Useful commands
8
+
9
+ * `cdk deploy` deploy this stack to your default AWS account/region
10
+ * `cdk diff` compare deployed stack with current state
11
+ * `cdk synth` emits the synthesized CloudFormation template
12
+ * `go test` run unit tests
human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/cdk.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "app": "go mod download && go run kinesis.go",
3
+ "watch": {
4
+ "include": [
5
+ "**"
6
+ ],
7
+ "exclude": [
8
+ "README.md",
9
+ "cdk*.json",
10
+ "go.mod",
11
+ "go.sum",
12
+ "**/*test.go"
13
+ ]
14
+ },
15
+ "context": {
16
+ "@aws-cdk/aws-lambda:recognizeLayerVersion": true,
17
+ "@aws-cdk/core:checkSecretUsage": true,
18
+ "@aws-cdk/core:target-partitions": [
19
+ "aws",
20
+ "aws-cn"
21
+ ],
22
+ "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
23
+ "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
24
+ "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
25
+ "@aws-cdk/aws-iam:minimizePolicies": true,
26
+ "@aws-cdk/core:validateSnapshotRemovalPolicy": true,
27
+ "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
28
+ "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
29
+ "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
30
+ "@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
31
+ "@aws-cdk/core:enablePartitionLiterals": true,
32
+ "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
33
+ "@aws-cdk/aws-iam:standardizedServicePrincipals": true,
34
+ "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
35
+ "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
36
+ "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
37
+ "@aws-cdk/aws-route53-patters:useCertificate": true,
38
+ "@aws-cdk/customresources:installLatestAwsSdkDefault": false,
39
+ "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
40
+ "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
41
+ "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
42
+ "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
43
+ "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
44
+ "@aws-cdk/aws-redshift:columnId": true,
45
+ "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
46
+ "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
47
+ "@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
48
+ "@aws-cdk/aws-kms:aliasNameRef": true,
49
+ "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
50
+ "@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
51
+ "@aws-cdk/aws-efs:denyAnonymousAccess": true,
52
+ "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
53
+ "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
54
+ "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
55
+ "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
56
+ "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
57
+ "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
58
+ "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
59
+ "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true,
60
+ "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true
61
+ }
62
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/go.mod ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module kinesis
2
+
3
+ go 1.18
4
+
5
+ require (
6
+ github.com/aws/aws-cdk-go/awscdk/v2 v2.131.0
7
+ github.com/aws/constructs-go/constructs/v10 v10.3.0
8
+ github.com/aws/jsii-runtime-go v1.94.0
9
+ )
10
+
11
+ require (
12
+ github.com/Masterminds/semver/v3 v3.2.1 // indirect
13
+ github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 // indirect
14
+ github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 // indirect
15
+ github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 // indirect
16
+ github.com/fatih/color v1.16.0 // indirect
17
+ github.com/mattn/go-colorable v0.1.13 // indirect
18
+ github.com/mattn/go-isatty v0.0.20 // indirect
19
+ github.com/yuin/goldmark v1.4.13 // indirect
20
+ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
21
+ golang.org/x/mod v0.14.0 // indirect
22
+ golang.org/x/sys v0.14.0 // indirect
23
+ golang.org/x/tools v0.16.1 // indirect
24
+ )
human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/kinesis.go ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ import (
4
+ "github.com/aws/aws-cdk-go/awscdk/v2"
5
+ "github.com/aws/aws-cdk-go/awscdk/v2/awskinesis"
6
+ "github.com/aws/aws-cdk-go/awscdk/v2/awskms"
7
+ "github.com/aws/constructs-go/constructs/v10"
8
+ "github.com/aws/jsii-runtime-go"
9
+ )
10
+
11
+ type KinesisStackProps struct {
12
+ awscdk.StackProps
13
+ }
14
+
15
+ func NewKinesisStack(scope constructs.Construct, id string, props *KinesisStackProps) awscdk.Stack {
16
+ var sprops awscdk.StackProps
17
+ if props != nil {
18
+ sprops = props.StackProps
19
+ }
20
+ stack := awscdk.NewStack(scope, &id, &sprops)
21
+
22
+ // Create KMS key for Kinesis stream encryption
23
+ key := awskms.NewKey(stack, jsii.String("KinesisEncryptionKey"), &awskms.KeyProps{
24
+ EnableKeyRotation: jsii.Bool(true),
25
+ })
26
+
27
+ // Create Kinesis stream with KMS enabled.
28
+ awskinesis.NewStream(stack, jsii.String("MyStream"), &awskinesis.StreamProps{
29
+ StreamName: jsii.String("MyKinesisDataStream"),
30
+ Encryption: awskinesis.StreamEncryption_KMS,
31
+ EncryptionKey: key,
32
+ })
33
+
34
+ return stack
35
+ }
36
+
37
+ func main() {
38
+ defer jsii.Close()
39
+
40
+ app := awscdk.NewApp(nil)
41
+
42
+ NewKinesisStack(app, "KinesisStack", &KinesisStackProps{
43
+ awscdk.StackProps{
44
+ Env: env(),
45
+ },
46
+ })
47
+
48
+ app.Synth(nil)
49
+ }
50
+
51
+ // env determines the AWS environment (account+region) in which our stack is to
52
+ // be deployed. For more information see: https://docs.aws.amazon.com/cdk/latest/guide/environments.html
53
+ func env() *awscdk.Environment {
54
+ // If unspecified, this stack will be "environment-agnostic".
55
+ // Account/Region-dependent features and context lookups will not work, but a
56
+ // single synthesized template can be deployed anywhere.
57
+ //---------------------------------------------------------------------------
58
+ return nil
59
+
60
+ // Uncomment if you know exactly what account and region you want to deploy
61
+ // the stack to. This is the recommendation for production stacks.
62
+ //---------------------------------------------------------------------------
63
+ // return &awscdk.Environment{
64
+ // Account: jsii.String("123456789012"),
65
+ // Region: jsii.String("us-east-1"),
66
+ // }
67
+
68
+ // Uncomment to specialize this stack for the AWS Account and Region that are
69
+ // implied by the current CLI configuration. This is recommended for dev
70
+ // stacks.
71
+ //---------------------------------------------------------------------------
72
+ // return &awscdk.Environment{
73
+ // Account: jsii.String(os.Getenv("CDK_DEFAULT_ACCOUNT")),
74
+ // Region: jsii.String(os.Getenv("CDK_DEFAULT_REGION")),
75
+ // }
76
+ }
human_reference_dataset/iac-model-evaluation/cdk/go/kinesis/kinesis_test.go ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ // import (
4
+ // "testing"
5
+
6
+ // "github.com/aws/aws-cdk-go/awscdk/v2"
7
+ // "github.com/aws/aws-cdk-go/awscdk/v2/assertions"
8
+ // "github.com/aws/jsii-runtime-go"
9
+ // )
10
+
11
+ // example tests. To run these tests, uncomment this file along with the
12
+ // example resource in kinesis_test.go
13
+ // func TestKinesisStack(t *testing.T) {
14
+ // // GIVEN
15
+ // app := awscdk.NewApp(nil)
16
+
17
+ // // WHEN
18
+ // stack := NewKinesisStack(app, "MyStack", nil)
19
+
20
+ // // THEN
21
+ // template := assertions.Template_FromStack(stack, nil)
22
+
23
+ // template.HasResourceProperties(jsii.String("AWS::SQS::Queue"), map[string]interface{}{
24
+ // "VisibilityTimeout": 300,
25
+ // })
26
+ // }
human_reference_dataset/iac-model-evaluation/cdk/go/lambda/.gitignore ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Binaries for programs and plugins
2
+ *.exe
3
+ *.exe~
4
+ *.dll
5
+ *.so
6
+ *.dylib
7
+
8
+ # Test binary, built with `go test -c`
9
+ *.test
10
+
11
+ # Output of the go coverage tool, specifically when used with LiteIDE
12
+ *.out
13
+
14
+ # go.sum should be committed
15
+ !go.sum
16
+
17
+ # CDK asset staging directory
18
+ .cdk.staging
19
+ cdk.out
human_reference_dataset/iac-model-evaluation/cdk/go/lambda/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Welcome to your CDK Go project!
2
+
3
+ This is a blank project for CDK development with Go.
4
+
5
+ The `cdk.json` file tells the CDK toolkit how to execute your app.
6
+
7
+ ## Useful commands
8
+
9
+ * `cdk deploy` deploy this stack to your default AWS account/region
10
+ * `cdk diff` compare deployed stack with current state
11
+ * `cdk synth` emits the synthesized CloudFormation template
12
+ * `go test` run unit tests
human_reference_dataset/iac-model-evaluation/cdk/go/lambda/cdk.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "app": "go mod download && go run lambda.go",
3
+ "watch": {
4
+ "include": [
5
+ "**"
6
+ ],
7
+ "exclude": [
8
+ "README.md",
9
+ "cdk*.json",
10
+ "go.mod",
11
+ "go.sum",
12
+ "**/*test.go"
13
+ ]
14
+ },
15
+ "context": {
16
+ "@aws-cdk/aws-lambda:recognizeLayerVersion": true,
17
+ "@aws-cdk/core:checkSecretUsage": true,
18
+ "@aws-cdk/core:target-partitions": [
19
+ "aws",
20
+ "aws-cn"
21
+ ],
22
+ "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
23
+ "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
24
+ "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true,
25
+ "@aws-cdk/aws-iam:minimizePolicies": true,
26
+ "@aws-cdk/core:validateSnapshotRemovalPolicy": true,
27
+ "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true,
28
+ "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true,
29
+ "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true,
30
+ "@aws-cdk/aws-apigateway:disableCloudWatchRole": true,
31
+ "@aws-cdk/core:enablePartitionLiterals": true,
32
+ "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true,
33
+ "@aws-cdk/aws-iam:standardizedServicePrincipals": true,
34
+ "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true,
35
+ "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true,
36
+ "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true,
37
+ "@aws-cdk/aws-route53-patters:useCertificate": true,
38
+ "@aws-cdk/customresources:installLatestAwsSdkDefault": false,
39
+ "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true,
40
+ "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true,
41
+ "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true,
42
+ "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true,
43
+ "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true,
44
+ "@aws-cdk/aws-redshift:columnId": true,
45
+ "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true,
46
+ "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true,
47
+ "@aws-cdk/aws-apigateway:requestValidatorUniqueId": true,
48
+ "@aws-cdk/aws-kms:aliasNameRef": true,
49
+ "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true,
50
+ "@aws-cdk/core:includePrefixInUniqueNameGeneration": true,
51
+ "@aws-cdk/aws-efs:denyAnonymousAccess": true,
52
+ "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true,
53
+ "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true,
54
+ "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true,
55
+ "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true,
56
+ "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true,
57
+ "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true,
58
+ "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
59
+ "@aws-cdk/aws-cloudwatch-actions:changeLambdaPermissionLogicalIdForLambdaAction": true,
60
+ "@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse": true
61
+ }
62
+ }