Skip to content

Commit

Permalink
Merge pull request #8618 from elysahall/awsdocs-04-01-24
Browse files Browse the repository at this point in the history
CLI examples for eks, imagebuilder, ivs-realtime
  • Loading branch information
kyleknap authored Apr 8, 2024
2 parents fe2f6a2 + 9d616d6 commit c5ed4a1
Show file tree
Hide file tree
Showing 9 changed files with 521 additions and 37 deletions.
27 changes: 27 additions & 0 deletions awscli/examples/eks/associate-encryption-config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
**To associates an encryption configuration to an existing cluster**

The following ``associate-encryption-config`` example enable's encryption on an existing EKS clusters that do not already have encryption enabled. ::

aws eks associate-encryption-config \
--cluster-name my-eks-cluster \
--encryption-config '[{"resources":["secrets"],"provider":{"keyArn":"arn:aws:kms:region-code:account:key/key"}}]'

Output::

{
"update": {
"id": "3141b835-8103-423a-8e68-12c2521ffa4d",
"status": "InProgress",
"type": "AssociateEncryptionConfig",
"params": [
{
"type": "EncryptionConfig",
"value": "[{\"resources\":[\"secrets\"],\"provider\":{\"keyArn\":\"arn:aws:kms:region-code:account:key/key\"}}]"
}
],
"createdAt": "2024-03-14T11:01:26.297000-04:00",
"errors": []
}
}

For more information, see `Enabling secret encryption on an existing cluster <https://docs.aws.amazon.com/eks/latest/userguide/enable-kms.html>`__ in the *Amazon EKS User Guide*.
191 changes: 191 additions & 0 deletions awscli/examples/eks/create-addon.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
**Example 1: To create an Amazon EKS add-on with default compatibile version for the respective EKS cluster version**

The following ``create-addon`` example command creates an Amazon EKS add-on with default compatibile version for the respective EKS cluster version. ::

aws eks create-addon \
--cluster-name my-eks-cluster \
--addon-name my-eks-addon \
--service-account-role-arn arn:aws:iam::111122223333:role/role-name

Output::

{
"addon": {
"addonName": "my-eks-addon",
"clusterName": "my-eks-cluster",
"status": "CREATING",
"addonVersion": "v1.15.1-eksbuild.1",
"health": {
"issues": []
},
"addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/1ec71ee1-b9c2-8915-4e17-e8be0a55a149",
"createdAt": "2024-03-14T12:20:03.264000-04:00",
"modifiedAt": "2024-03-14T12:20:03.283000-04:00",
"serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
"tags": {}
}
}

For more information, see `Managing Amazon EKS add-ons - Creating an add-on <https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on>`__ in the *Amazon EKS User Guide*.

**Example 2: To create an Amazon EKS add-on with specific add-on version**

The following ``create-addon`` example command creates an Amazon EKS add-on with specific add-on version. ::

aws eks create-addon \
--cluster-name my-eks-cluster \
--addon-name my-eks-addon \
--service-account-role-arn arn:aws:iam::111122223333:role/role-name \
--addon-version v1.16.4-eksbuild.2

Output::

{
"addon": {
"addonName": "my-eks-addon",
"clusterName": "my-eks-cluster",
"status": "CREATING",
"addonVersion": "v1.16.4-eksbuild.2",
"health": {
"issues": []
},
"addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/34c71ee6-7738-6c8b-c6bd-3921a176b5ff",
"createdAt": "2024-03-14T12:30:24.507000-04:00",
"modifiedAt": "2024-03-14T12:30:24.521000-04:00",
"serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
"tags": {}
}
}

For more information, see `Managing Amazon EKS add-ons - Creating an add-on <https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on>`__ in the *Amazon EKS User Guide*.

**Example 3: To create an Amazon EKS add-on with custom configuration values and resolve conflicts details**

The following ``create-addon`` example command creates an Amazon EKS add-on with custom configuration values and resolves conflicts details. ::

aws eks create-addon \
--cluster-name my-eks-cluster \
--addon-name my-eks-addon \
--service-account-role-arn arn:aws:iam::111122223333:role/role-name \
--addon-version v1.16.4-eksbuild.2 \
--configuration-values '{"resources":{"limits":{"cpu":"100m"}}}' \
--resolve-conflicts OVERWRITE

Output::

{
"addon": {
"addonName": "my-eks-addon",
"clusterName": "my-eks-cluster",
"status": "CREATING",
"addonVersion": "v1.16.4-eksbuild.2",
"health": {
"issues": []
},
"addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/a6c71ee9-0304-9237-1be8-25af1b0f1ffb",
"createdAt": "2024-03-14T12:35:58.313000-04:00",
"modifiedAt": "2024-03-14T12:35:58.327000-04:00",
"serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
"tags": {},
"configurationValues": "{\"resources\":{\"limits\":{\"cpu\":\"100m\"}}}"
}
}

For more information, see `Managing Amazon EKS add-ons - Creating an add-on <https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on>`__ in the *Amazon EKS User Guide*.

**Example 4: To create an Amazon EKS add-on with custom JSON configuration values file**

The following ``create-addon`` example command creates an Amazon EKS add-on with custom configuration values and resolve conflicts details. ::

aws eks create-addon \
--cluster-name my-eks-cluster \
--addon-name my-eks-addon \
--service-account-role-arn arn:aws:iam::111122223333:role/role-name \
--addon-version v1.16.4-eksbuild.2 \
--configuration-values 'file://configuration-values.json' \
--resolve-conflicts OVERWRITE \
--tags '{"eks-addon-key-1": "value-1" , "eks-addon-key-2": "value-2"}'

Contents of ``configuration-values.json``::

{
"resources": {
"limits": {
"cpu": "150m"
}
},
"env": {
"AWS_VPC_K8S_CNI_LOGLEVEL": "ERROR"
}
}

Output::

{
"addon": {
"addonName": "my-eks-addon",
"clusterName": "my-eks-cluster",
"status": "CREATING",
"addonVersion": "v1.16.4-eksbuild.2",
"health": {
"issues": []
},
"addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/d8c71ef8-fbd8-07d0-fb32-6a7be19ececd",
"createdAt": "2024-03-14T13:10:51.763000-04:00",
"modifiedAt": "2024-03-14T13:10:51.777000-04:00",
"serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
"tags": {
"eks-addon-key-1": "value-1",
"eks-addon-key-2": "value-2"
},
"configurationValues": "{\n \"resources\": {\n \"limits\": {\n \"cpu\": \"150m\"\n }\n },\n \"env\": {\n \"AWS_VPC_K8S_CNI_LOGLEVEL\": \"ERROR\"\n }\n}"
}
}

For more information, see `Managing Amazon EKS add-ons - Creating an add-on <https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on>`__ in the *Amazon EKS User Guide*.

**Example 5: To create an Amazon EKS add-on with custom YAML configuration values file**

The following ``create-addon`` example command creates an Amazon EKS add-on with custom configuration values and resolve conflicts details. ::

aws eks create-addon \
--cluster-name my-eks-cluster \
--addon-name my-eks-addon \
--service-account-role-arn arn:aws:iam::111122223333:role/role-name \
--addon-version v1.16.4-eksbuild.2 \
--configuration-values 'file://configuration-values.yaml' \
--resolve-conflicts OVERWRITE \
--tags '{"eks-addon-key-1": "value-1" , "eks-addon-key-2": "value-2"}'

Contents of ``configuration-values.yaml``::

resources:
limits:
cpu: '100m'
env:
AWS_VPC_K8S_CNI_LOGLEVEL: 'DEBUG'

Output::

{
"addon": {
"addonName": "my-eks-addon",
"clusterName": "my-eks-cluster",
"status": "CREATING",
"addonVersion": "v1.16.4-eksbuild.2",
"health": {
"issues": []
},
"addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/d4c71efb-3909-6f36-a548-402cd4b5d59e",
"createdAt": "2024-03-14T13:15:45.220000-04:00",
"modifiedAt": "2024-03-14T13:15:45.237000-04:00",
"serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
"tags": {
"eks-addon-key-3": "value-3",
"eks-addon-key-4": "value-4"
},
"configurationValues": "resources:\n limits:\n cpu: '100m'\nenv:\n AWS_VPC_K8S_CNI_LOGLEVEL: 'INFO'"
}
}

For more information, see `Managing Amazon EKS add-ons - Creating an add-on <https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#creating-an-add-on>`__ in the *Amazon EKS User Guide*.
57 changes: 57 additions & 0 deletions awscli/examples/eks/delete-addon.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
**Example 1. To deletes an Amazon EKS add-on but preserve the add-on software on the EKS Cluster**

The following ``delete-addon`` example command deletes an Amazon EKS add-on but preserve the add-on software on the EKS Cluster. ::

aws eks delete-addon \
--cluster-name my-eks-cluster \
--addon-name my-eks-addon \
--preserve

Output::

{
"addon": {
"addonName": "my-eks-addon",
"clusterName": "my-eks-cluster",
"status": "DELETING",
"addonVersion": "v1.9.3-eksbuild.7",
"health": {
"issues": []
},
"addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/a8c71ed3-944e-898b-9167-c763856af4b8",
"createdAt": "2024-03-14T11:49:09.009000-04:00",
"modifiedAt": "2024-03-14T12:03:49.776000-04:00",
"tags": {}
}
}

For more information, see `Managing Amazon EKS add-ons - Deleting an add-on <https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#removing-an-add-on>`__ in the *Amazon EKS*.

**Example 2. To deletes an Amazon EKS add-on and also delete the add-on software from the EKS Cluster**

The following ``delete-addon`` example command deletes an Amazon EKS add-on and also delete the add-on software from the EKS Cluster. ::

aws eks delete-addon \
--cluster-name my-eks-cluster \
--addon-name my-eks-addon

Output::

{
"addon": {
"addonName": "my-eks-addon",
"clusterName": "my-eks-cluster",
"status": "DELETING",
"addonVersion": "v1.15.1-eksbuild.1",
"health": {
"issues": []
},
"addonArn": "arn:aws:eks:us-east-2:111122223333:addon/my-eks-cluster/my-eks-addon/bac71ed1-ec43-3bb6-88ea-f243cdb58954",
"createdAt": "2024-03-14T11:45:31.983000-04:00",
"modifiedAt": "2024-03-14T11:58:40.136000-04:00",
"serviceAccountRoleArn": "arn:aws:iam::111122223333:role/role-name",
"tags": {}
}
}

For more information, see `Managing Amazon EKS add-ons - Deleting an add-on <https://docs.aws.amazon.com/eks/latest/userguide/managing-add-ons.html#removing-an-add-on>`__ in the *Amazon EKS*.
109 changes: 85 additions & 24 deletions awscli/examples/eks/describe-update.rst
Original file line number Diff line number Diff line change
@@ -1,30 +1,91 @@
**To describe an update for a cluster**
**Example 1: To describe an update for a cluster**

This example command describes an update for a cluster named ``example`` in your default region.
The following ``describe-update`` example describes an update for a cluster named. ::

Command::
aws eks describe-update \
--name my-eks-cluster \
--update-id 10bddb13-a71b-425a-b0a6-71cd03e59161

aws eks describe-update --name example \
--update-id 10bddb13-a71b-425a-b0a6-71cd03e59161
Output::

{
"update": {
"id": "10bddb13-a71b-425a-b0a6-71cd03e59161",
"status": "Successful",
"type": "EndpointAccessUpdate",
"params": [
{
"type": "EndpointPublicAccess",
"value": "false"
},
{
"type": "EndpointPrivateAccess",
"value": "true"
}
],
"createdAt": "2024-03-14T10:01:26.297000-04:00",
"errors": []
}
}

For more information, see `Updating an Amazon EKS cluster Kubernetes version <https://docs.aws.amazon.com/eks/latest/userguide/update-cluster.html>`__ in the *Amazon EKS User Guide*.

**Example 2: To describe an update for a cluster**

The following ``describe-update`` example describes an update for a cluster named. ::

aws eks describe-update \
--name my-eks-cluster \
--update-id e4994991-4c0f-475a-a040-427e6da52966

Output::

{
"update": {
"id": "e4994991-4c0f-475a-a040-427e6da52966",
"status": "Successful",
"type": "AssociateEncryptionConfig",
"params": [
{
"type": "EncryptionConfig",
"value": "[{\"resources\":[\"secrets\"],\"provider\":{\"keyArn\":\"arn:aws:kms:region-code:account:key/key\"}}]"
}
],
"createdAt": "2024-03-14T11:01:26.297000-04:00",
"errors": []
}
}

For more information, see `Updating an Amazon EKS cluster Kubernetes version <https://docs.aws.amazon.com/eks/latest/userguide/update-cluster.html>`__ in the *Amazon EKS User Guide*.

**Example 3: To describe an update for a cluster**

The following ``describe-update`` example describes an update for a cluster named. ::

aws eks describe-update \
--name my-eks-cluster \
--update-id b5f0ba18-9a87-4450-b5a0-825e6e84496f

Output::

{
"update": {
"id": "10bddb13-a71b-425a-b0a6-71cd03e59161",
"status": "Successful",
"type": "EndpointAccessUpdate",
"params": [
{
"type": "EndpointPublicAccess",
"value": "true"
},
{
"type": "EndpointPrivateAccess",
"value": "false"
}
],
"createdAt": 1565806691.149,
"errors": []
}
}
{
"update": {
"id": "b5f0ba18-9a87-4450-b5a0-825e6e84496f",
"status": "Successful",
"type": "VersionUpdate",
"params": [
{
"type": "Version",
"value": "1.29"
},
{
"type": "PlatformVersion",
"value": "eks.1"
}
],
"createdAt": "2024-03-14T12:05:26.297000-04:00",
"errors": []
}
}

For more information, see `Updating an Amazon EKS cluster Kubernetes version <https://docs.aws.amazon.com/eks/latest/userguide/update-cluster.html>`__ in the *Amazon EKS User Guide*.
Loading

0 comments on commit c5ed4a1

Please sign in to comment.