@aws-cdk/lambda-layer-kubectl-v33 2.0.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/.gitpod.yml +7 -0
- package/.jsii +3583 -0
- package/API.md +311 -0
- package/CODE_OF_CONDUCT.md +4 -0
- package/CONTRIBUTING.md +117 -0
- package/LICENSE +202 -0
- package/NOTICE +1 -0
- package/README.md +32 -0
- package/layer/.dockerignore +1 -0
- package/layer/Dockerfile +49 -0
- package/layer/build.sh +20 -0
- package/lib/_asset.d.ts +2 -0
- package/lib/_asset.js +20 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +18 -0
- package/lib/kubectl-layer.d.ts +8 -0
- package/lib/kubectl-layer.js +25 -0
- package/lib/layer.zip +0 -0
- package/new-kubectl-layer.sh +115 -0
- package/package.json +160 -0
package/API.md
ADDED
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# API Reference <a name="API Reference" id="api-reference"></a>
|
|
2
|
+
|
|
3
|
+
## Constructs <a name="Constructs" id="Constructs"></a>
|
|
4
|
+
|
|
5
|
+
### KubectlV33Layer <a name="KubectlV33Layer" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer"></a>
|
|
6
|
+
|
|
7
|
+
A CDK Asset construct that contains `kubectl` and `helm`.
|
|
8
|
+
|
|
9
|
+
#### Initializers <a name="Initializers" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.Initializer"></a>
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33'
|
|
13
|
+
|
|
14
|
+
new KubectlV33Layer(scope: Construct, id: string)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| **Name** | **Type** | **Description** |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
20
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.Initializer.parameter.scope"></a>
|
|
25
|
+
|
|
26
|
+
- *Type:* constructs.Construct
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
##### `id`<sup>Required</sup> <a name="id" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.Initializer.parameter.id"></a>
|
|
31
|
+
|
|
32
|
+
- *Type:* string
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
37
|
+
|
|
38
|
+
| **Name** | **Description** |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
41
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.applyRemovalPolicy">applyRemovalPolicy</a></code> | Apply the given removal policy to this resource. |
|
|
42
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.addPermission">addPermission</a></code> | Add permission for this layer version to specific entities. |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
##### `toString` <a name="toString" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.toString"></a>
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
public toString(): string
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Returns a string representation of this construct.
|
|
53
|
+
|
|
54
|
+
##### `applyRemovalPolicy` <a name="applyRemovalPolicy" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.applyRemovalPolicy"></a>
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
public applyRemovalPolicy(policy: RemovalPolicy): void
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Apply the given removal policy to this resource.
|
|
61
|
+
|
|
62
|
+
The Removal Policy controls what happens to this resource when it stops
|
|
63
|
+
being managed by CloudFormation, either because you've removed it from the
|
|
64
|
+
CDK application or because you've made a change that requires the resource
|
|
65
|
+
to be replaced.
|
|
66
|
+
|
|
67
|
+
The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
|
|
68
|
+
account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
|
|
69
|
+
|
|
70
|
+
###### `policy`<sup>Required</sup> <a name="policy" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.applyRemovalPolicy.parameter.policy"></a>
|
|
71
|
+
|
|
72
|
+
- *Type:* aws-cdk-lib.RemovalPolicy
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
##### `addPermission` <a name="addPermission" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.addPermission"></a>
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
public addPermission(id: string, permission: LayerVersionPermission): void
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Add permission for this layer version to specific entities.
|
|
83
|
+
|
|
84
|
+
Usage within
|
|
85
|
+
the same account where the layer is defined is always allowed and does not
|
|
86
|
+
require calling this method. Note that the principal that creates the
|
|
87
|
+
Lambda function using the layer (for example, a CloudFormation changeset
|
|
88
|
+
execution role) also needs to have the ``lambda:GetLayerVersion``
|
|
89
|
+
permission on the layer version.
|
|
90
|
+
|
|
91
|
+
###### `id`<sup>Required</sup> <a name="id" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.addPermission.parameter.id"></a>
|
|
92
|
+
|
|
93
|
+
- *Type:* string
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
###### `permission`<sup>Required</sup> <a name="permission" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.addPermission.parameter.permission"></a>
|
|
98
|
+
|
|
99
|
+
- *Type:* aws-cdk-lib.aws_lambda.LayerVersionPermission
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
104
|
+
|
|
105
|
+
| **Name** | **Description** |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
108
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.isOwnedResource">isOwnedResource</a></code> | Returns true if the construct was created by CDK, and false otherwise. |
|
|
109
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.isResource">isResource</a></code> | Check whether the given construct is a Resource. |
|
|
110
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.fromLayerVersionArn">fromLayerVersionArn</a></code> | Imports a layer version by ARN. |
|
|
111
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.fromLayerVersionAttributes">fromLayerVersionAttributes</a></code> | Imports a Layer that has been defined externally. |
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
##### ~~`isConstruct`~~ <a name="isConstruct" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.isConstruct"></a>
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33'
|
|
119
|
+
|
|
120
|
+
KubectlV33Layer.isConstruct(x: any)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Checks if `x` is a construct.
|
|
124
|
+
|
|
125
|
+
###### `x`<sup>Required</sup> <a name="x" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.isConstruct.parameter.x"></a>
|
|
126
|
+
|
|
127
|
+
- *Type:* any
|
|
128
|
+
|
|
129
|
+
Any object.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
##### `isOwnedResource` <a name="isOwnedResource" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.isOwnedResource"></a>
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33'
|
|
137
|
+
|
|
138
|
+
KubectlV33Layer.isOwnedResource(construct: IConstruct)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Returns true if the construct was created by CDK, and false otherwise.
|
|
142
|
+
|
|
143
|
+
###### `construct`<sup>Required</sup> <a name="construct" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.isOwnedResource.parameter.construct"></a>
|
|
144
|
+
|
|
145
|
+
- *Type:* constructs.IConstruct
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
##### `isResource` <a name="isResource" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.isResource"></a>
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33'
|
|
153
|
+
|
|
154
|
+
KubectlV33Layer.isResource(construct: IConstruct)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Check whether the given construct is a Resource.
|
|
158
|
+
|
|
159
|
+
###### `construct`<sup>Required</sup> <a name="construct" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.isResource.parameter.construct"></a>
|
|
160
|
+
|
|
161
|
+
- *Type:* constructs.IConstruct
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
##### `fromLayerVersionArn` <a name="fromLayerVersionArn" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.fromLayerVersionArn"></a>
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33'
|
|
169
|
+
|
|
170
|
+
KubectlV33Layer.fromLayerVersionArn(scope: Construct, id: string, layerVersionArn: string)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Imports a layer version by ARN.
|
|
174
|
+
|
|
175
|
+
Assumes it is compatible with all Lambda runtimes.
|
|
176
|
+
|
|
177
|
+
###### `scope`<sup>Required</sup> <a name="scope" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.fromLayerVersionArn.parameter.scope"></a>
|
|
178
|
+
|
|
179
|
+
- *Type:* constructs.Construct
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
###### `id`<sup>Required</sup> <a name="id" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.fromLayerVersionArn.parameter.id"></a>
|
|
184
|
+
|
|
185
|
+
- *Type:* string
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
###### `layerVersionArn`<sup>Required</sup> <a name="layerVersionArn" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.fromLayerVersionArn.parameter.layerVersionArn"></a>
|
|
190
|
+
|
|
191
|
+
- *Type:* string
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
##### `fromLayerVersionAttributes` <a name="fromLayerVersionAttributes" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.fromLayerVersionAttributes"></a>
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v33'
|
|
199
|
+
|
|
200
|
+
KubectlV33Layer.fromLayerVersionAttributes(scope: Construct, id: string, attrs: LayerVersionAttributes)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Imports a Layer that has been defined externally.
|
|
204
|
+
|
|
205
|
+
###### `scope`<sup>Required</sup> <a name="scope" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.fromLayerVersionAttributes.parameter.scope"></a>
|
|
206
|
+
|
|
207
|
+
- *Type:* constructs.Construct
|
|
208
|
+
|
|
209
|
+
the parent Construct that will use the imported layer.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
###### `id`<sup>Required</sup> <a name="id" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.fromLayerVersionAttributes.parameter.id"></a>
|
|
214
|
+
|
|
215
|
+
- *Type:* string
|
|
216
|
+
|
|
217
|
+
the id of the imported layer in the construct tree.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
###### `attrs`<sup>Required</sup> <a name="attrs" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.fromLayerVersionAttributes.parameter.attrs"></a>
|
|
222
|
+
|
|
223
|
+
- *Type:* aws-cdk-lib.aws_lambda.LayerVersionAttributes
|
|
224
|
+
|
|
225
|
+
the properties of the imported layer.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
230
|
+
|
|
231
|
+
| **Name** | **Type** | **Description** |
|
|
232
|
+
| --- | --- | --- |
|
|
233
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
234
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.property.env">env</a></code> | <code>aws-cdk-lib.ResourceEnvironment</code> | The environment this resource belongs to. |
|
|
235
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.property.stack">stack</a></code> | <code>aws-cdk-lib.Stack</code> | The stack in which this resource is defined. |
|
|
236
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.property.layerVersionArn">layerVersionArn</a></code> | <code>string</code> | The ARN of the Lambda Layer version that this Layer defines. |
|
|
237
|
+
| <code><a href="#@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.property.compatibleRuntimes">compatibleRuntimes</a></code> | <code>aws-cdk-lib.aws_lambda.Runtime[]</code> | The runtimes compatible with this Layer. |
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
##### `node`<sup>Required</sup> <a name="node" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.property.node"></a>
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
public readonly node: Node;
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
- *Type:* constructs.Node
|
|
248
|
+
|
|
249
|
+
The tree node.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
##### `env`<sup>Required</sup> <a name="env" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.property.env"></a>
|
|
254
|
+
|
|
255
|
+
```typescript
|
|
256
|
+
public readonly env: ResourceEnvironment;
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
- *Type:* aws-cdk-lib.ResourceEnvironment
|
|
260
|
+
|
|
261
|
+
The environment this resource belongs to.
|
|
262
|
+
|
|
263
|
+
For resources that are created and managed by the CDK
|
|
264
|
+
(generally, those created by creating new class instances like Role, Bucket, etc.),
|
|
265
|
+
this is always the same as the environment of the stack they belong to;
|
|
266
|
+
however, for imported resources
|
|
267
|
+
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
|
|
268
|
+
that might be different than the stack they were imported into.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
##### `stack`<sup>Required</sup> <a name="stack" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.property.stack"></a>
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
public readonly stack: Stack;
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
- *Type:* aws-cdk-lib.Stack
|
|
279
|
+
|
|
280
|
+
The stack in which this resource is defined.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
##### `layerVersionArn`<sup>Required</sup> <a name="layerVersionArn" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.property.layerVersionArn"></a>
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
public readonly layerVersionArn: string;
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
- *Type:* string
|
|
291
|
+
|
|
292
|
+
The ARN of the Lambda Layer version that this Layer defines.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
##### `compatibleRuntimes`<sup>Optional</sup> <a name="compatibleRuntimes" id="@aws-cdk/lambda-layer-kubectl-v33.KubectlV33Layer.property.compatibleRuntimes"></a>
|
|
297
|
+
|
|
298
|
+
```typescript
|
|
299
|
+
public readonly compatibleRuntimes: Runtime[];
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
- *Type:* aws-cdk-lib.aws_lambda.Runtime[]
|
|
303
|
+
|
|
304
|
+
The runtimes compatible with this Layer.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
## Code of Conduct
|
|
2
|
+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
|
|
3
|
+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
|
|
4
|
+
opensource-codeofconduct@amazon.com with any additional questions or comments.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Contributing Guidelines
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
|
|
4
|
+
documentation, we greatly value feedback and contributions from our community.
|
|
5
|
+
|
|
6
|
+
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
|
|
7
|
+
information to effectively respond to your bug report or contribution.
|
|
8
|
+
|
|
9
|
+
Specifically, if you wish to contribute a new Kubectl Asset with a different kubectl version, jump to [Contributing a new Kubectl Asset](#contributing-a-new-kubectl-asset).
|
|
10
|
+
|
|
11
|
+
## Supported Versions
|
|
12
|
+
|
|
13
|
+
Similar to [kubernetes](https://kubernetes.io/releases/), we support the most recent three minor versions.
|
|
14
|
+
This means that we continue to upgrade dependencies for the most recent three versions.
|
|
15
|
+
|
|
16
|
+
We also plan to have the default branch of this repository to be the latest released version. If that is
|
|
17
|
+
not the case, please raise a GitHub Issue with us!
|
|
18
|
+
|
|
19
|
+
## Reporting Bugs/Feature Requests
|
|
20
|
+
|
|
21
|
+
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
|
|
22
|
+
|
|
23
|
+
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
|
|
24
|
+
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
|
|
25
|
+
|
|
26
|
+
* A reproducible test case or series of steps
|
|
27
|
+
* The version of our code being used
|
|
28
|
+
* Any modifications you've made relevant to the bug
|
|
29
|
+
* Anything unusual about your environment or deployment
|
|
30
|
+
|
|
31
|
+
## Contributing via Pull Requests
|
|
32
|
+
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
|
|
33
|
+
|
|
34
|
+
1. You are working against the latest source on the *kubectl-v21/main* branch.
|
|
35
|
+
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
|
|
36
|
+
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
|
|
37
|
+
|
|
38
|
+
To send us a pull request, please:
|
|
39
|
+
|
|
40
|
+
1. Fork the repository.
|
|
41
|
+
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
|
|
42
|
+
3. Ensure local tests pass.
|
|
43
|
+
4. Commit to your fork using clear commit messages.
|
|
44
|
+
5. Send us a pull request, answering any default questions in the pull request interface.
|
|
45
|
+
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
|
|
46
|
+
|
|
47
|
+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
|
|
48
|
+
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
|
|
49
|
+
|
|
50
|
+
## Contributing a new Kubectl Asset
|
|
51
|
+
If you would like to contribute a new Kubectl Asset with a different kubectl version, please follow these steps:
|
|
52
|
+
|
|
53
|
+
1. Open a new GitHub issue titled `Feature Request: Asset with kubectl vX.Y.Z`. We will track the progress of the new
|
|
54
|
+
Asset in the issue.
|
|
55
|
+
2. If we decide to support the requested version, a maintainer will create the new version by running the `new-kubectl-layer.sh`
|
|
56
|
+
script, providing in the latest versions of kubectl and helm. For example, if bumping from Kubectl version 1.32.x,
|
|
57
|
+
alongside Helm version 3.17.x, run the script as such:
|
|
58
|
+
```shell
|
|
59
|
+
./bump.sh 32 17
|
|
60
|
+
```
|
|
61
|
+
Alternatively, they could follow these legacy steps:
|
|
62
|
+
- Open a new branch, `kubectl-vY/main` (Y is the minor version) and update the issue accordingly. The maintainer will also open a
|
|
63
|
+
branch called `kubectl.vY`in the corresponding go binding repository, [`cdklabs/awscdk-kubectl-go`](https://github.com/cdklabs/awscdk-kubectl-go/branches).
|
|
64
|
+
- Create a fork of the repository and fetch the `kubectl-vY/main` branch locally, and modify the source off of that.
|
|
65
|
+
- Specifically:
|
|
66
|
+
- change `README.md` to reflect the new versions of kubectl and helm that the asset will include.
|
|
67
|
+
- change `KUBECTL_VERSION` and `HELM_VERSION` in `layer/Dockerfile` to reflect the new versions.
|
|
68
|
+
The `HELM_VERSION` you select should be the highest version compatible with the `KUBECTL_VERSION`
|
|
69
|
+
according to the helm [docs](https://helm.sh/docs/topics/version_skew/). For example, if
|
|
70
|
+
`KUBECTL_VERSION` is v1.20.x, then the `HELM_VERSION` should be v3.8.x.
|
|
71
|
+
- change `SPEC_VERSION` in `.projenrc.js` to reflect the new minor version of kubectl.
|
|
72
|
+
For example, if `KUBECTL_VERSION` is v1.25.0, then `SPEC_VERSION` should be 25.
|
|
73
|
+
- change the Kubectl Lambda layer class in `src/kubectl-layer.ts` to `KubectlV##Layer`, and its `description` field to reflect the latest versions of Kubectl and Helm being supported.
|
|
74
|
+
- change `test/kubectl-layer.test.ts` to reflect the new construct's name (changed in the previous step) and that the description
|
|
75
|
+
verifies the correct versions of Kubectl and Helm.
|
|
76
|
+
- change `test/kubectl-layer.integ.ts` to reflect the new construct's name (changed in the previous step).
|
|
77
|
+
- for an example of code changes done for Kubectl v1.22.0, see this [PR](https://github.com/cdklabs/awscdk-asset-kubectl/pull/7).
|
|
78
|
+
- Run `npx projen compile` to generate the Lambda layer constructs that will be tested.
|
|
79
|
+
- Run `npx projen` to update the github workflows.
|
|
80
|
+
- Run `npx projen integ:kubectl-layer:deploy` to ensure that the new versions in the Dockerfile can be successfully downloaded.
|
|
81
|
+
This stage _must succeed_ before proceeding.
|
|
82
|
+
When it succeeds, confirm that the snapshot in `test/kubectl-layer.integ.snapshot` has been updated. If not, run `npx projen integ:kubectl-layer:snapshot` to update it.
|
|
83
|
+
- Run `yarn build` to ensure everything builds correctly.
|
|
84
|
+
- Commit to your fork and submit a pull request to the repository, _ensuring that you are targeting the correct `kubectl-vY/main` branch_.
|
|
85
|
+
3. A maintainer will review your contribution from there!
|
|
86
|
+
4. ⚠️ **IMPORTANT FOR THE MAINTAINER** ⚠️ The maintainer should go into the repository settings and update the default branch to this new, latest version that has just been merged in. This is because GitHub only runs actions on default branches, and we want to ensure dependencies are updated in the latest version + the previous 3 versions.
|
|
87
|
+
|
|
88
|
+
## Backporting changes to branches with different Kubectl versions
|
|
89
|
+
This repository consists of multiple branches, with each branch corresponding to a specific Kubectl version.
|
|
90
|
+
For example, `kubectl-v24/main` is the branch that releases a Lambda Layer that bundles Kubectl version 1.24.
|
|
91
|
+
Sometimes, a contribution made to a specific branch should be propogated to other branches in this repository as well.
|
|
92
|
+
To do this, you can add `backport-to-kubectl-v21+` as a label to the PR that tells Mergify to backport when the PR is merged.
|
|
93
|
+
This will backport to all versions of kubectl except kubectl v1.20, which is special and does not expose a Lambda Layer.
|
|
94
|
+
|
|
95
|
+
If you think you need to backport to a specific subset of branches instead, you can ask a maintainer to backport via
|
|
96
|
+
a mergify comment:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
@Mergifyio backport kubectl-v21/main kubectl-v22/main
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Finding contributions to work on
|
|
103
|
+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
|
|
104
|
+
|
|
105
|
+
## Code of Conduct
|
|
106
|
+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
|
|
107
|
+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
|
|
108
|
+
opensource-codeofconduct@amazon.com with any additional questions or comments.
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
## Security issue notifications
|
|
112
|
+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## Licensing
|
|
116
|
+
|
|
117
|
+
See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Lambda Layer with KubeCtl v1.33
|
|
2
|
+
<!--BEGIN STABILITY BANNER-->
|
|
3
|
+
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!--END STABILITY BANNER-->
|
|
11
|
+
|
|
12
|
+
This module exports a single class called `KubectlV33Layer` which is a `lambda.LayerVersion` that
|
|
13
|
+
bundles the [`kubectl`](https://kubernetes.io/docs/reference/kubectl/kubectl/) and the
|
|
14
|
+
[`helm`](https://helm.sh/) command line.
|
|
15
|
+
|
|
16
|
+
> - Helm Version: 3.18.0
|
|
17
|
+
> - Kubectl Version: 1.33.0
|
|
18
|
+
>
|
|
19
|
+
|
|
20
|
+
Usage:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
// KubectlLayer bundles the 'kubectl' and 'helm' command lines
|
|
24
|
+
import { KubectlV33Layer } from '@aws-cdk/lambda-layer-kubectl-v32';
|
|
25
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
26
|
+
|
|
27
|
+
declare const fn: lambda.Function;
|
|
28
|
+
const kubectl = new KubectlV33Layer(this, 'KubectlLayer');
|
|
29
|
+
fn.addLayers(kubectl);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`kubectl` will be installed under `/opt/kubectl/kubectl`, and `helm` will be installed under `/opt/helm/helm`.
|