cdk-ecr-deployment 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +51 -26
- package/API.md +16 -0
- package/README.md +6 -5
- package/changelog.md +2 -2
- package/lambda/go.mod +22 -3
- package/lambda/go.sum +202 -29
- package/lambda/main.go +22 -0
- package/lambda/utils.go +37 -0
- package/lambda/utils_test.go +8 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.js +21 -8
- package/package.json +1 -1
- package/releasetag.txt +1 -1
- package/version.txt +1 -1
package/.jsii
CHANGED
|
@@ -2872,7 +2872,7 @@
|
|
|
2872
2872
|
},
|
|
2873
2873
|
"name": "cdk-ecr-deployment",
|
|
2874
2874
|
"readme": {
|
|
2875
|
-
"markdown": "# cdk-ecr-deployment\n\n[](https://github.com/wchaws/cdk-ecr-deployment/actions/workflows/release.yml)\n[](https://www.npmjs.com/package/cdk-ecr-deployment)\n[](https://pypi.org/project/cdk-ecr-deployment)\n[](https://www.npmjs.com/package/cdk-ecr-deployment)\n[](https://pypi.org/project/cdk-ecr-deployment)\n\nCDK construct to
|
|
2875
|
+
"markdown": "# cdk-ecr-deployment\n\n[](https://github.com/wchaws/cdk-ecr-deployment/actions/workflows/release.yml)\n[](https://www.npmjs.com/package/cdk-ecr-deployment)\n[](https://pypi.org/project/cdk-ecr-deployment)\n[](https://www.npmjs.com/package/cdk-ecr-deployment)\n[](https://pypi.org/project/cdk-ecr-deployment)\n\nCDK construct to synchronize single docker image between docker registries.\n\n⚠️ Please use ^1.0.0 for cdk version 1.x.x, use ^2.0.0 for cdk version 2.x.x\n\n## Features\n\n- Copy image from ECR/external registry to (another) ECR/external registry\n- Copy an archive tarball image from s3 to ECR/external registry\n\n⚠️ Currently construct can authenticate to external registry only with basic auth, but credentials are put as plain text to template and logs. See issue [#171](https://github.com/cdklabs/cdk-ecr-deployment/issues/171).\n\n## Examples\n\nRun [test/integ.ecr-deployment.ts](./test/integ.ecr-deployment.ts)\n\n```shell\nNO_PREBUILT_LAMBDA=1 npx cdk deploy -a \"npx ts-node -P tsconfig.dev.json --prefer-ts-exts test/integ.ecr-deployment.ts\"\n```\n\n## Tech Details & Contribution\n\nThe core of this project relies on [containers/image](https://github.com/containers/image) which is used by [Skopeo](https://github.com/containers/skopeo).\nPlease take a look at those projects before contribution.\n\nTo support a new docker image source(like docker tarball in s3), you need to implement [image transport interface](https://github.com/containers/image/blob/master/types/types.go). You could take a look at [docker-archive](https://github.com/containers/image/blob/ccb87a8d0f45cf28846e307eb0ec2b9d38a458c2/docker/archive/transport.go) transport for a good start.\n\nTo test the `lambda` folder, `make test`.\n"
|
|
2876
2876
|
},
|
|
2877
2877
|
"repository": {
|
|
2878
2878
|
"type": "git",
|
|
@@ -2901,7 +2901,7 @@
|
|
|
2901
2901
|
},
|
|
2902
2902
|
"locationInModule": {
|
|
2903
2903
|
"filename": "src/index.ts",
|
|
2904
|
-
"line":
|
|
2904
|
+
"line": 117
|
|
2905
2905
|
},
|
|
2906
2906
|
"parameters": [
|
|
2907
2907
|
{
|
|
@@ -2925,7 +2925,7 @@
|
|
|
2925
2925
|
"kind": "class",
|
|
2926
2926
|
"locationInModule": {
|
|
2927
2927
|
"filename": "src/index.ts",
|
|
2928
|
-
"line":
|
|
2928
|
+
"line": 116
|
|
2929
2929
|
},
|
|
2930
2930
|
"name": "DockerImageName",
|
|
2931
2931
|
"properties": [
|
|
@@ -2938,7 +2938,7 @@
|
|
|
2938
2938
|
"immutable": true,
|
|
2939
2939
|
"locationInModule": {
|
|
2940
2940
|
"filename": "src/index.ts",
|
|
2941
|
-
"line":
|
|
2941
|
+
"line": 118
|
|
2942
2942
|
},
|
|
2943
2943
|
"name": "uri",
|
|
2944
2944
|
"overrides": "cdk-ecr-deployment.IImageName",
|
|
@@ -2952,7 +2952,7 @@
|
|
|
2952
2952
|
},
|
|
2953
2953
|
"locationInModule": {
|
|
2954
2954
|
"filename": "src/index.ts",
|
|
2955
|
-
"line":
|
|
2955
|
+
"line": 117
|
|
2956
2956
|
},
|
|
2957
2957
|
"name": "creds",
|
|
2958
2958
|
"optional": true,
|
|
@@ -2977,7 +2977,7 @@
|
|
|
2977
2977
|
},
|
|
2978
2978
|
"locationInModule": {
|
|
2979
2979
|
"filename": "src/index.ts",
|
|
2980
|
-
"line":
|
|
2980
|
+
"line": 135
|
|
2981
2981
|
},
|
|
2982
2982
|
"parameters": [
|
|
2983
2983
|
{
|
|
@@ -3003,8 +3003,33 @@
|
|
|
3003
3003
|
"kind": "class",
|
|
3004
3004
|
"locationInModule": {
|
|
3005
3005
|
"filename": "src/index.ts",
|
|
3006
|
-
"line":
|
|
3006
|
+
"line": 132
|
|
3007
3007
|
},
|
|
3008
|
+
"methods": [
|
|
3009
|
+
{
|
|
3010
|
+
"docs": {
|
|
3011
|
+
"stability": "stable"
|
|
3012
|
+
},
|
|
3013
|
+
"locationInModule": {
|
|
3014
|
+
"filename": "src/index.ts",
|
|
3015
|
+
"line": 196
|
|
3016
|
+
},
|
|
3017
|
+
"name": "addToPrincipalPolicy",
|
|
3018
|
+
"parameters": [
|
|
3019
|
+
{
|
|
3020
|
+
"name": "statement",
|
|
3021
|
+
"type": {
|
|
3022
|
+
"fqn": "aws-cdk-lib.aws_iam.PolicyStatement"
|
|
3023
|
+
}
|
|
3024
|
+
}
|
|
3025
|
+
],
|
|
3026
|
+
"returns": {
|
|
3027
|
+
"type": {
|
|
3028
|
+
"fqn": "aws-cdk-lib.aws_iam.AddToPrincipalPolicyResult"
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
],
|
|
3008
3033
|
"name": "ECRDeployment",
|
|
3009
3034
|
"symbolId": "src/index:ECRDeployment"
|
|
3010
3035
|
},
|
|
@@ -3018,7 +3043,7 @@
|
|
|
3018
3043
|
"kind": "interface",
|
|
3019
3044
|
"locationInModule": {
|
|
3020
3045
|
"filename": "src/index.ts",
|
|
3021
|
-
"line":
|
|
3046
|
+
"line": 11
|
|
3022
3047
|
},
|
|
3023
3048
|
"name": "ECRDeploymentProps",
|
|
3024
3049
|
"properties": [
|
|
@@ -3031,7 +3056,7 @@
|
|
|
3031
3056
|
"immutable": true,
|
|
3032
3057
|
"locationInModule": {
|
|
3033
3058
|
"filename": "src/index.ts",
|
|
3034
|
-
"line":
|
|
3059
|
+
"line": 31
|
|
3035
3060
|
},
|
|
3036
3061
|
"name": "dest",
|
|
3037
3062
|
"type": {
|
|
@@ -3047,7 +3072,7 @@
|
|
|
3047
3072
|
"immutable": true,
|
|
3048
3073
|
"locationInModule": {
|
|
3049
3074
|
"filename": "src/index.ts",
|
|
3050
|
-
"line":
|
|
3075
|
+
"line": 26
|
|
3051
3076
|
},
|
|
3052
3077
|
"name": "src",
|
|
3053
3078
|
"type": {
|
|
@@ -3065,7 +3090,7 @@
|
|
|
3065
3090
|
"immutable": true,
|
|
3066
3091
|
"locationInModule": {
|
|
3067
3092
|
"filename": "src/index.ts",
|
|
3068
|
-
"line":
|
|
3093
|
+
"line": 22
|
|
3069
3094
|
},
|
|
3070
3095
|
"name": "buildImage",
|
|
3071
3096
|
"optional": true,
|
|
@@ -3082,7 +3107,7 @@
|
|
|
3082
3107
|
"immutable": true,
|
|
3083
3108
|
"locationInModule": {
|
|
3084
3109
|
"filename": "src/index.ts",
|
|
3085
|
-
"line":
|
|
3110
|
+
"line": 69
|
|
3086
3111
|
},
|
|
3087
3112
|
"name": "environment",
|
|
3088
3113
|
"optional": true,
|
|
@@ -3106,7 +3131,7 @@
|
|
|
3106
3131
|
"immutable": true,
|
|
3107
3132
|
"locationInModule": {
|
|
3108
3133
|
"filename": "src/index.ts",
|
|
3109
|
-
"line":
|
|
3134
|
+
"line": 42
|
|
3110
3135
|
},
|
|
3111
3136
|
"name": "memoryLimit",
|
|
3112
3137
|
"optional": true,
|
|
@@ -3124,7 +3149,7 @@
|
|
|
3124
3149
|
"immutable": true,
|
|
3125
3150
|
"locationInModule": {
|
|
3126
3151
|
"filename": "src/index.ts",
|
|
3127
|
-
"line":
|
|
3152
|
+
"line": 49
|
|
3128
3153
|
},
|
|
3129
3154
|
"name": "role",
|
|
3130
3155
|
"optional": true,
|
|
@@ -3142,7 +3167,7 @@
|
|
|
3142
3167
|
"immutable": true,
|
|
3143
3168
|
"locationInModule": {
|
|
3144
3169
|
"filename": "src/index.ts",
|
|
3145
|
-
"line":
|
|
3170
|
+
"line": 56
|
|
3146
3171
|
},
|
|
3147
3172
|
"name": "vpc",
|
|
3148
3173
|
"optional": true,
|
|
@@ -3161,7 +3186,7 @@
|
|
|
3161
3186
|
"immutable": true,
|
|
3162
3187
|
"locationInModule": {
|
|
3163
3188
|
"filename": "src/index.ts",
|
|
3164
|
-
"line":
|
|
3189
|
+
"line": 64
|
|
3165
3190
|
},
|
|
3166
3191
|
"name": "vpcSubnets",
|
|
3167
3192
|
"optional": true,
|
|
@@ -3181,7 +3206,7 @@
|
|
|
3181
3206
|
"kind": "interface",
|
|
3182
3207
|
"locationInModule": {
|
|
3183
3208
|
"filename": "src/index.ts",
|
|
3184
|
-
"line":
|
|
3209
|
+
"line": 72
|
|
3185
3210
|
},
|
|
3186
3211
|
"name": "IImageName",
|
|
3187
3212
|
"properties": [
|
|
@@ -3195,7 +3220,7 @@
|
|
|
3195
3220
|
"immutable": true,
|
|
3196
3221
|
"locationInModule": {
|
|
3197
3222
|
"filename": "src/index.ts",
|
|
3198
|
-
"line":
|
|
3223
|
+
"line": 78
|
|
3199
3224
|
},
|
|
3200
3225
|
"name": "uri",
|
|
3201
3226
|
"type": {
|
|
@@ -3205,13 +3230,13 @@
|
|
|
3205
3230
|
{
|
|
3206
3231
|
"abstract": true,
|
|
3207
3232
|
"docs": {
|
|
3208
|
-
"remarks": "Format `user:
|
|
3233
|
+
"remarks": "Format `user:password` or `AWS Secrets Manager secret arn` or `AWS Secrets Manager secret name`",
|
|
3209
3234
|
"stability": "stable",
|
|
3210
3235
|
"summary": "The credentials of the docker image."
|
|
3211
3236
|
},
|
|
3212
3237
|
"locationInModule": {
|
|
3213
3238
|
"filename": "src/index.ts",
|
|
3214
|
-
"line":
|
|
3239
|
+
"line": 83
|
|
3215
3240
|
},
|
|
3216
3241
|
"name": "creds",
|
|
3217
3242
|
"optional": true,
|
|
@@ -3234,7 +3259,7 @@
|
|
|
3234
3259
|
},
|
|
3235
3260
|
"locationInModule": {
|
|
3236
3261
|
"filename": "src/index.ts",
|
|
3237
|
-
"line":
|
|
3262
|
+
"line": 123
|
|
3238
3263
|
},
|
|
3239
3264
|
"parameters": [
|
|
3240
3265
|
{
|
|
@@ -3265,7 +3290,7 @@
|
|
|
3265
3290
|
"kind": "class",
|
|
3266
3291
|
"locationInModule": {
|
|
3267
3292
|
"filename": "src/index.ts",
|
|
3268
|
-
"line":
|
|
3293
|
+
"line": 121
|
|
3269
3294
|
},
|
|
3270
3295
|
"name": "S3ArchiveName",
|
|
3271
3296
|
"properties": [
|
|
@@ -3278,7 +3303,7 @@
|
|
|
3278
3303
|
"immutable": true,
|
|
3279
3304
|
"locationInModule": {
|
|
3280
3305
|
"filename": "src/index.ts",
|
|
3281
|
-
"line":
|
|
3306
|
+
"line": 129
|
|
3282
3307
|
},
|
|
3283
3308
|
"name": "uri",
|
|
3284
3309
|
"overrides": "cdk-ecr-deployment.IImageName",
|
|
@@ -3292,7 +3317,7 @@
|
|
|
3292
3317
|
},
|
|
3293
3318
|
"locationInModule": {
|
|
3294
3319
|
"filename": "src/index.ts",
|
|
3295
|
-
"line":
|
|
3320
|
+
"line": 123
|
|
3296
3321
|
},
|
|
3297
3322
|
"name": "creds",
|
|
3298
3323
|
"optional": true,
|
|
@@ -3305,6 +3330,6 @@
|
|
|
3305
3330
|
"symbolId": "src/index:S3ArchiveName"
|
|
3306
3331
|
}
|
|
3307
3332
|
},
|
|
3308
|
-
"version": "2.
|
|
3309
|
-
"fingerprint": "
|
|
3333
|
+
"version": "2.4.0",
|
|
3334
|
+
"fingerprint": "d5kP3wOkagNaML4hX/yNBeSbDzUd8ZQTzfYJ5ZG/XOQ="
|
|
3310
3335
|
}
|
package/API.md
CHANGED
|
@@ -83,6 +83,22 @@ new ECRDeployment(scope: Construct, id: string, props: ECRDeploymentProps)
|
|
|
83
83
|
* **vpcSubnets** (<code>[aws_ec2.SubnetSelection](#aws-cdk-lib-aws-ec2-subnetselection)</code>) Where in the VPC to place the deployment lambda handler. __*Default*__: the Vpc default strategy if not specified
|
|
84
84
|
|
|
85
85
|
|
|
86
|
+
### Methods
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
#### addToPrincipalPolicy(statement) <a id="cdk-ecr-deployment-ecrdeployment-addtoprincipalpolicy"></a>
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
addToPrincipalPolicy(statement: PolicyStatement): AddToPrincipalPolicyResult
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
* **statement** (<code>[aws_iam.PolicyStatement](#aws-cdk-lib-aws-iam-policystatement)</code>) *No description*
|
|
98
|
+
|
|
99
|
+
__Returns__:
|
|
100
|
+
* <code>[aws_iam.AddToPrincipalPolicyResult](#aws-cdk-lib-aws-iam-addtoprincipalpolicyresult)</code>
|
|
101
|
+
|
|
86
102
|
|
|
87
103
|
|
|
88
104
|
## class S3ArchiveName <a id="cdk-ecr-deployment-s3archivename"></a>
|
package/README.md
CHANGED
|
@@ -6,15 +6,16 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/cdk-ecr-deployment)
|
|
7
7
|
[](https://pypi.org/project/cdk-ecr-deployment)
|
|
8
8
|
|
|
9
|
-
CDK construct to
|
|
9
|
+
CDK construct to synchronize single docker image between docker registries.
|
|
10
10
|
|
|
11
11
|
⚠️ Please use ^1.0.0 for cdk version 1.x.x, use ^2.0.0 for cdk version 2.x.x
|
|
12
12
|
|
|
13
13
|
## Features
|
|
14
14
|
|
|
15
|
-
- Copy
|
|
16
|
-
- Copy
|
|
17
|
-
|
|
15
|
+
- Copy image from ECR/external registry to (another) ECR/external registry
|
|
16
|
+
- Copy an archive tarball image from s3 to ECR/external registry
|
|
17
|
+
|
|
18
|
+
⚠️ Currently construct can authenticate to external registry only with basic auth, but credentials are put as plain text to template and logs. See issue [#171](https://github.com/cdklabs/cdk-ecr-deployment/issues/171).
|
|
18
19
|
|
|
19
20
|
## Examples
|
|
20
21
|
|
|
@@ -26,7 +27,7 @@ NO_PREBUILT_LAMBDA=1 npx cdk deploy -a "npx ts-node -P tsconfig.dev.json --prefe
|
|
|
26
27
|
|
|
27
28
|
## Tech Details & Contribution
|
|
28
29
|
|
|
29
|
-
The core of this project relies on https://github.com/containers/image which is used by https://github.com/containers/skopeo.
|
|
30
|
+
The core of this project relies on [containers/image](https://github.com/containers/image) which is used by [Skopeo](https://github.com/containers/skopeo).
|
|
30
31
|
Please take a look at those projects before contribution.
|
|
31
32
|
|
|
32
33
|
To support a new docker image source(like docker tarball in s3), you need to implement [image transport interface](https://github.com/containers/image/blob/master/types/types.go). You could take a look at [docker-archive](https://github.com/containers/image/blob/ccb87a8d0f45cf28846e307eb0ec2b9d38a458c2/docker/archive/transport.go) transport for a good start.
|
package/changelog.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
## [2.
|
|
2
|
+
## [2.4.0](https://github.com/cdklabs/cdk-ecr-deployment/compare/v2.3.2...v2.4.0) (2022-03-06)
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
### Features
|
|
6
6
|
|
|
7
|
-
*
|
|
7
|
+
* support getting external registry credentials from secrets/parameter store ([5824d07](https://github.com/cdklabs/cdk-ecr-deployment/commit/5824d0780819115a3bd7e4fb430077d256ba8796))
|
package/lambda/go.mod
CHANGED
|
@@ -3,20 +3,39 @@ module cdk-ecr-deployment-handler
|
|
|
3
3
|
go 1.15
|
|
4
4
|
|
|
5
5
|
require (
|
|
6
|
+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
|
7
|
+
github.com/Microsoft/go-winio v0.5.1 // indirect
|
|
8
|
+
github.com/Microsoft/hcsshim v0.9.2 // indirect
|
|
6
9
|
github.com/aws/aws-lambda-go v1.23.0
|
|
7
|
-
github.com/aws/aws-sdk-go-v2 v1.
|
|
10
|
+
github.com/aws/aws-sdk-go-v2 v1.14.0
|
|
8
11
|
github.com/aws/aws-sdk-go-v2/config v1.1.6
|
|
12
|
+
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.6 // indirect
|
|
9
13
|
github.com/aws/aws-sdk-go-v2/service/ecr v1.2.2
|
|
10
14
|
github.com/aws/aws-sdk-go-v2/service/s3 v1.5.0
|
|
11
|
-
github.com/
|
|
15
|
+
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.14.0
|
|
16
|
+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
|
17
|
+
github.com/containerd/cgroups v1.0.3 // indirect
|
|
18
|
+
github.com/containerd/containerd v1.5.10 // indirect
|
|
12
19
|
github.com/containers/image/v5 v5.17.0
|
|
13
20
|
github.com/docker/distribution v2.8.0+incompatible // indirect
|
|
14
21
|
github.com/docker/docker v20.10.12+incompatible // indirect
|
|
15
22
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
|
|
23
|
+
github.com/hashicorp/errwrap v1.1.0 // indirect
|
|
24
|
+
github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 // indirect
|
|
16
25
|
github.com/opencontainers/go-digest v1.0.0
|
|
17
26
|
github.com/opencontainers/image-spec v1.0.3-0.20211202193544-a5463b7f9c84 // indirect
|
|
18
|
-
github.com/opencontainers/runc v1.0
|
|
27
|
+
github.com/opencontainers/runc v1.1.0 // indirect
|
|
19
28
|
github.com/pkg/errors v0.9.1
|
|
29
|
+
github.com/prometheus/common v0.30.0 // indirect
|
|
30
|
+
github.com/prometheus/procfs v0.7.3 // indirect
|
|
20
31
|
github.com/sirupsen/logrus v1.8.1
|
|
21
32
|
github.com/stretchr/testify v1.7.0
|
|
33
|
+
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
|
|
34
|
+
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
|
|
35
|
+
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
|
|
36
|
+
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
|
|
37
|
+
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
|
|
38
|
+
google.golang.org/grpc v1.43.0 // indirect
|
|
39
|
+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
|
40
|
+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
|
22
41
|
)
|