Skip to content
v2.274.0

HelmChart ​

Represents a helm chart within the Kubernetes system.

Applies/deletes the resources using kubectl in sync with the resource.

Example ​

ts
declare const cluster: eks.Cluster;
// option 1: use a construct
new eks.HelmChart(this, 'MyOCIChart', {
  cluster,
  chart: 'some-chart',
  repository: 'oci://${ACCOUNT_ID}.dkr.ecr.${ACCOUNT_REGION}.amazonaws.com/${REPO_NAME}',
  namespace: 'oci',
  version: '0.0.1'
});
python
# cluster: eks.Cluster

# option 1: use a construct
eks.HelmChart(self, "MyOCIChart",
    cluster=cluster,
    chart="some-chart",
    repository="oci://${ACCOUNT_ID}.dkr.ecr.${ACCOUNT_REGION}.amazonaws.com/${REPO_NAME}",
    namespace="oci",
    version="0.0.1"
)
java
Cluster cluster;

// option 1: use a construct
// option 1: use a construct
HelmChart.Builder.create(this, "MyOCIChart")
        .cluster(cluster)
        .chart("some-chart")
        .repository("oci://${ACCOUNT_ID}.dkr.ecr.${ACCOUNT_REGION}.amazonaws.com/${REPO_NAME}")
        .namespace("oci")
        .version("0.0.1")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Cluster cluster;

// option 1: use a construct
// option 1: use a construct
new HelmChart(this, "MyOCIChart", new HelmChartProps {
    Cluster = cluster,
    Chart = "some-chart",
    Repository = "oci://${ACCOUNT_ID}.dkr.ecr.${ACCOUNT_REGION}.amazonaws.com/${REPO_NAME}",
    Namespace = "oci",
    Version = "0.0.1"
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cluster Cluster

// option 1: use a construct
// option 1: use a construct
eks.NewHelmChart(this, jsii.String("MyOCIChart"), &HelmChartProps{
	Cluster: Cluster,
	Chart: jsii.String("some-chart"),
	Repository: jsii.String("oci://${ACCOUNT_ID}.dkr.ecr.${ACCOUNT_REGION}.amazonaws.com/${REPO_NAME}"),
	Namespace: jsii.String("oci"),
	Version: jsii.String("0.0.1"),
})

Initializer ​

ts
new HelmChart(scope: Construct, id: string, props: HelmChartProps)
python
HelmChart(scope: Construct, id: str, props: HelmChartProps)
java
new HelmChart(Construct scope, String id, HelmChartProps props)
csharp
new HelmChart(Construct scope, string id, HelmChartProps props)
go
NewHelmChart(Scope Construct, Id *string, Props HelmChartProps)

Construct Props ​

atomicoptionalbooleanatomicoptionalboolatomicoptionalBooleanAtomicoptionalboolAtomicoptional*bool= false#
Whether or not Helm should treat this operation as atomic;

if set, upgrade process rolls back changes made in case of failed upgrade. The --wait flag will be set automatically if --atomic is used.

chartoptionalstringchartoptionalstrchartoptionalStringChartoptionalstringChartoptional*string#
The name of the chart.

Default: No chart name. Implies chartAsset is used.

Either this or chartAsset must be specified.

chartAssetoptionalAssetchart_assetoptionalAssetchartAssetoptionalAssetChartAssetoptionalAssetChartAssetoptionalAsset#
The chart in the form of an asset.

Default: No chart asset. Implies chart is used.

Either this or chart must be specified.

clusterIClusterclusterIClusterclusterIClusterClusterIClusterClusterIClusterrequired#
The EKS cluster to apply this configuration to.

[disable-awslint:ref-via-interface]

createNamespaceoptionalbooleancreate_namespaceoptionalboolcreateNamespaceoptionalBooleanCreateNamespaceoptionalboolCreateNamespaceoptional*bool= true#
create namespace if not exist.
namespaceoptionalstringnamespaceoptionalstrnamespaceoptionalStringNamespaceoptionalstringNamespaceoptional*string= default#
The Kubernetes namespace scope of the requests.
releaseoptionalstringreleaseoptionalstrreleaseoptionalStringReleaseoptionalstringReleaseoptional*string#
The name of the release.

Default: If no release name is given, it will use the last 53 characters of the node's unique id.

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.DESTROY#
The removal policy applied to the custom resource that manages the Helm chart.
notes

The removal policy controls what happens to the resource if it stops being managed by CloudFormation. This can happen in one of three situations:

  • The resource is removed from the template, so CloudFormation stops managing it
  • A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it
  • The stack is deleted, so CloudFormation stops managing all resources in it
repositoryoptionalstringrepositoryoptionalstrrepositoryoptionalStringRepositoryoptionalstringRepositoryoptional*string#
The repository which contains the chart.

Default: No repository will be used, which means that the chart needs to be an absolute URL.

For example: https://charts.helm.sh/stable/

skipCrdsoptionalbooleanskip_crdsoptionalboolskipCrdsoptionalBooleanSkipCrdsoptionalboolSkipCrdsoptional*bool#
if set, no CRDs will be installed.

Default: CRDs are installed if not already present

timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration= Duration.minutes(5)#
Amount of time to wait for any individual Kubernetes operation.

Maximum 15 minutes.

valuesoptional{ [key: string]: any }valuesoptionaltyping.Mapping[str, Any]valuesoptionalMap<String, Object>ValuesoptionalIDictionary<string, object>Valuesoptional*map[string]interface{}#
The values to be used by the chart.

Default: No values are provided to the chart.

For nested values use a nested dictionary. For example: values: { installationCRDs: true, webhook: { port: 9443 } }

versionoptionalstringversionoptionalstrversionoptionalStringVersionoptionalstringVersionoptional*string#
The chart version to install.

Default: If this is not specified, the latest version is installed

waitoptionalbooleanwaitoptionalboolwaitoptionalBooleanWaitoptionalboolWaitoptional*bool#
Whether or not Helm should wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet are in a ready state before marking the release as successful.

Default: Helm will not wait before marking release as successful

Properties ​

atomicmay be undefinedbooleanatomicmay be undefinedboolatomicmay be undefinedBooleanAtomicmay be undefinedboolAtomicmay be undefined*bool#
chartmay be undefinedstringchartmay be undefinedstrchartmay be undefinedStringChartmay be undefinedstringChartmay be undefined*string#
chartAssetmay be undefinedAssetchart_assetmay be undefinedAssetchartAssetmay be undefinedAssetChartAssetmay be undefinedAssetChartAssetmay be undefinedAsset#
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
repositorymay be undefinedstringrepositorymay be undefinedstrrepositorymay be undefinedStringRepositorymay be undefinedstringRepositorymay be undefined*string#
RESOURCE_TYPEstringresource_typestrRESOURCE_TYPEStringRESOURCE_TYPEstringRESOURCE_TYPE*stringrequiredstatic#
The CloudFormation resource type.
versionmay be undefinedstringversionmay be undefinedstrversionmay be undefinedStringVersionmay be undefinedstringVersionmay be undefined*string#

Methods ​

isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining