Skip to content

Commit

Permalink
Merge branch 'awserik-awserik-association' into develop
Browse files Browse the repository at this point in the history
PR aws#3949.

* awserik-awserik-association:
  Add new ssm examples
  • Loading branch information
jamesls committed Mar 1, 2019
2 parents a8c7c72 + f3b2086 commit c4f0988
Show file tree
Hide file tree
Showing 12 changed files with 348 additions and 103 deletions.
48 changes: 25 additions & 23 deletions awscli/examples/ssm/create-association-batch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,61 @@ This example associates a configuration document with multiple instances. The ou

Command::

aws ssm create-association-batch --entries "Name=AWS-UpdateSSMAgent,InstanceId=i-0cb2b964d3e14fd9f" "Name=AWS-UpdateSSMAgent,InstanceId=i-0000293ffd8c57862"
aws ssm create-association-batch --entries "Name=AWS-UpdateSSMAgent,InstanceId=i-1234567890abcdef0" "Name=AWS-UpdateSSMAgent,InstanceId=i-9876543210abcdef0"

Output::

{
"Successful": [
{
"Name": "AWS-UpdateSSMAgent",
"InstanceId": "i-1234567890abcdef0",
"AssociationVersion": "1",
"Date": 1550504725.007,
"LastUpdateAssociationDate": 1550504725.007,
"Status": {
"Date": 1487876122.564,
"Message": "Associated with AWS-UpdateSSMAgent",
"Name": "Associated"
"Date": 1550504725.007,
"Name": "Associated",
"Message": "Associated with AWS-UpdateSSMAgent"
},
"Name": "AWS-UpdateSSMAgent",
"InstanceId": "i-0000293ffd8c57862",
"Overview": {
"Status": "Pending",
"DetailedStatus": "Creating"
},
"AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0",
"DocumentVersion": "$DEFAULT",
"LastUpdateAssociationDate": 1487876122.564,
"Date": 1487876122.564,
"AssociationId": "8dfe3659-4309-493a-8755-0123456789ab",
"Targets": [
{
"Key": "InstanceIds",
"Values": [
"i-0000293ffd8c57862"
],
"Key": "InstanceIds"
"i-1234567890abcdef0"
]
}
]
},
{
"Name": "AWS-UpdateSSMAgent",
"InstanceId": "i-9876543210abcdef0",
"AssociationVersion": "1",
"Date": 1550504725.057,
"LastUpdateAssociationDate": 1550504725.057,
"Status": {
"Date": 1487876122.595,
"Message": "Associated with AWS-UpdateSSMAgent",
"Name": "Associated"
"Date": 1550504725.057,
"Name": "Associated",
"Message": "Associated with AWS-UpdateSSMAgent"
},
"Name": "AWS-UpdateSSMAgent",
"InstanceId": "i-0cb2b964d3e14fd9f",
"Overview": {
"Status": "Pending",
"DetailedStatus": "Creating"
},
"AssociationId": "2ccfbc46-5fe4-4e5c-ba46-70b56cc93f53",
"DocumentVersion": "$DEFAULT",
"LastUpdateAssociationDate": 1487876122.595,
"Date": 1487876122.595,
"AssociationId": "9c9f7f20-5154-4fed-a83e-0123456789ab",
"Targets": [
{
"Key": "InstanceIds",
"Values": [
"i-0cb2b964d3e14fd9f"
],
"Key": "InstanceIds"
"i-9876543210abcdef0"
]
}
]
}
Expand Down
10 changes: 9 additions & 1 deletion awscli/examples/ssm/delete-association.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ This example deletes the association between an instance and a document. There i

Command::

aws ssm delete-association --instance-id "i-0cb2b964d3e14fd9f" --name "AWS-UpdateSSMAgent"
aws ssm delete-association --instance-id "i-1234567890abcdef0" --name "AWS-UpdateSSMAgent"

**To delete an association using the association ID**

This example deletes the association for the specified association ID. There is no output if the command succeeds.

Command::

aws ssm delete-association --association-id "8dfe3659-4309-493a-8755-0123456789ab"
28 changes: 28 additions & 0 deletions awscli/examples/ssm/describe-association-execution-targets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
**To get details of an association execution**

This example describes the specified association execution.

Command::

aws ssm describe-association-execution-targets --association-id "8dfe3659-4309-493a-8755-0123456789ab" --execution-id "7abb6378-a4a5-4f10-8312-0123456789ab"

Output::

{
"AssociationExecutionTargets": [
{
"AssociationId": "8dfe3659-4309-493a-8755-0123456789ab",
"AssociationVersion": "1",
"ExecutionId": "7abb6378-a4a5-4f10-8312-0123456789ab",
"ResourceId": "i-1234567890abcdef0",
"ResourceType": "ManagedInstance",
"Status": "Success",
"DetailedStatus": "Success",
"LastExecutionDate": 1550505538.497,
"OutputSource": {
"OutputSourceId": "97fff367-fc5a-4299-aed8-0123456789ab",
"OutputSourceType": "RunCommand"
}
}
]
}
57 changes: 57 additions & 0 deletions awscli/examples/ssm/describe-association-executions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
**To get details of all executions for an association**

This example describes all executions of the specified association.

Command::

aws ssm describe-association-executions --association-id "8dfe3659-4309-493a-8755-0123456789ab"

Output::

{
"AssociationExecutions": [
{
"AssociationId": "8dfe3659-4309-493a-8755-0123456789ab",
"AssociationVersion": "1",
"ExecutionId": "474925ef-1249-45a2-b93d-0123456789ab",
"Status": "Success",
"DetailedStatus": "Success",
"CreatedTime": 1550505827.119,
"ResourceCountByStatus": "{Success=1}"
},
{
"AssociationId": "8dfe3659-4309-493a-8755-0123456789ab",
"AssociationVersion": "1",
"ExecutionId": "7abb6378-a4a5-4f10-8312-0123456789ab",
"Status": "Success",
"DetailedStatus": "Success",
"CreatedTime": 1550505536.843,
"ResourceCountByStatus": "{Success=1}"
},
...
]
}

**To get details of all executions for an association after a specific date and time**

This example describes all executions of an association after the specified date and time.

Command::

aws ssm describe-association-executions --association-id "8dfe3659-4309-493a-8755-0123456789ab" --filters "Key=CreatedTime,Value=2019-02-18T16:00:00Z,Type=GREATER_THAN"

Output::

{
"AssociationExecutions": [
{
"AssociationId": "8dfe3659-4309-493a-8755-0123456789ab",
"AssociationVersion": "1",
"ExecutionId": "474925ef-1249-45a2-b93d-0123456789ab",
"Status": "Success",
"DetailedStatus": "Success",
"CreatedTime": 1550505827.119,
"ResourceCountByStatus": "{Success=1}"
}
]
}
79 changes: 75 additions & 4 deletions awscli/examples/ssm/describe-association.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,81 @@
**To get details of an association**

This example describes the association for the specified association ID.

Command::

aws ssm describe-association --association-id "8dfe3659-4309-493a-8755-0123456789ab"

Output::

{
"AssociationDescription": {
"Name": "AWS-GatherSoftwareInventory",
"AssociationVersion": "1",
"Date": 1534864780.995,
"LastUpdateAssociationDate": 1543235759.81,
"Overview": {
"Status": "Success",
"AssociationStatusAggregatedCount": {
"Success": 2
}
},
"DocumentVersion": "$DEFAULT",
"Parameters": {
"applications": [
"Enabled"
],
"awsComponents": [
"Enabled"
],
"customInventory": [
"Enabled"
],
"files": [
""
],
"instanceDetailedInformation": [
"Enabled"
],
"networkConfig": [
"Enabled"
],
"services": [
"Enabled"
],
"windowsRegistry": [
""
],
"windowsRoles": [
"Enabled"
],
"windowsUpdates": [
"Enabled"
]
},
"AssociationId": "8dfe3659-4309-493a-8755-0123456789ab",
"Targets": [
{
"Key": "InstanceIds",
"Values": [
"*"
]
}
],
"ScheduleExpression": "rate(24 hours)",
"LastExecutionDate": 1550501886.0,
"LastSuccessfulExecutionDate": 1550501886.0,
"AssociationName": "Inventory-Association"
}
}

**To get details of an association for a specific instance and document**

This example describes the association between an instance and a document.

Command::

aws ssm describe-association --instance-id "i-0000293ffd8c57862" --name "AWS-UpdateSSMAgent"
aws ssm describe-association --instance-id "i-1234567890abcdef0" --name "AWS-UpdateSSMAgent"

Output::

Expand All @@ -16,22 +87,22 @@ Output::
"Name": "Associated"
},
"Name": "AWS-UpdateSSMAgent",
"InstanceId": "i-0000293ffd8c57862",
"InstanceId": "i-1234567890abcdef0",
"Overview": {
"Status": "Pending",
"DetailedStatus": "Associated",
"AssociationStatusAggregatedCount": {
"Pending": 1
}
},
"AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0",
"AssociationId": "d8617c07-2079-4c18-9847-1234567890ab",
"DocumentVersion": "$DEFAULT",
"LastUpdateAssociationDate": 1487876122.564,
"Date": 1487876122.564,
"Targets": [
{
"Values": [
"i-0000293ffd8c57862"
"i-1234567890abcdef0"
],
"Key": "InstanceIds"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ This example describes the effective associations for an instance.

Command::

aws ssm describe-effective-instance-associations --instance-id "i-0000293ffd8c57862"
aws ssm describe-effective-instance-associations --instance-id "i-1234567890abcdef0"
Output::

{
"Associations": [
{
"InstanceId": "i-0000293ffd8c57862",
"AssociationId": "8dfe3659-4309-493a-8755-0123456789ab",
"InstanceId": "i-1234567890abcdef0",
"Content": "{\n \"schemaVersion\": \"1.2\",\n \"description\": \"Update the Amazon SSM Agent to the latest version or specified version.\",\n \"parameters\": {\n \"version\": {\n \"default\": \"\",\n \"description\": \"(Optional) A specific version of the Amazon SSM Agent to install. If not specified, the agent will be updated to the latest version.\",\n \"type\": \"String\"\n },\n \"allowDowngrade\": {\n \"default\": \"false\",\n \"description\": \"(Optional) Allow the Amazon SSM Agent service to be downgraded to an earlier version. If set to false, the service can be upgraded to newer versions only (default). If set to true, specify the earlier version.\",\n \"type\": \"String\",\n \"allowedValues\": [\n \"true\",\n \"false\"\n ]\n }\n },\n \"runtimeConfig\": {\n \"aws:updateSsmAgent\": {\n \"properties\": [\n {\n \"agentName\": \"amazon-ssm-agent\",\n \"source\": \"https://s3.{Region}.amazonaws.com/amazon-ssm-{Region}/ssm-agent-manifest.json\",\n \"allowDowngrade\": \"{{ allowDowngrade }}\",\n \"targetVersion\": \"{{ version }}\"\n }\n ]\n }\n }\n}\n",
"AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0"
"AssociationVersion": "1"
}
]
}
}
26 changes: 20 additions & 6 deletions awscli/examples/ssm/describe-instance-associations-status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,33 @@ This example shows details of the associations for an instance.

Command::

aws ssm describe-instance-associations-status --instance-id "i-0000293ffd8c57862"
aws ssm describe-instance-associations-status --instance-id "i-1234567890abcdef0"

Output::

{
"InstanceAssociationStatusInfos": [
{
"Status": "Pending",
"DetailedStatus": "Associated",
"AssociationId": "8dfe3659-4309-493a-8755-0123456789ab",
"Name": "AWS-GatherSoftwareInventory",
"DocumentVersion": "1",
"AssociationVersion": "1",
"InstanceId": "i-1234567890abcdef0",
"ExecutionDate": 1550501886.0,
"Status": "Success",
"ExecutionSummary": "1 out of 1 plugin processed, 1 success, 0 failed, 0 timedout, 0 skipped. ",
"AssociationName": "Inventory-Association"
},
{
"AssociationId": "5c5a31f6-6dae-46f9-944c-0123456789ab",
"Name": "AWS-UpdateSSMAgent",
"InstanceId": "i-0000293ffd8c57862",
"AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0",
"DocumentVersion": "1"
"DocumentVersion": "1",
"AssociationVersion": "1",
"InstanceId": "i-1234567890abcdef0",
"ExecutionDate": 1550505828.548,
"Status": "Success",
"DetailedStatus": "Success",
"AssociationName": "UpdateSSMAgent"
}
]
}
38 changes: 38 additions & 0 deletions awscli/examples/ssm/list-association-versions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
**To list all versions of an association for a specific association ID**

This example lists all versions of the specified associations.

Command::

aws ssm list-association-versions --association-id "8dfe3659-4309-493a-8755-0123456789ab"

Output::

{
"AssociationVersions": [
{
"AssociationId": "8dfe3659-4309-493a-8755-0123456789ab",
"AssociationVersion": "1",
"CreatedDate": 1550505536.726,
"Name": "AWS-UpdateSSMAgent",
"Parameters": {
"allowDowngrade": [
"false"
],
"version": [
""
]
},
"Targets": [
{
"Key": "InstanceIds",
"Values": [
"i-1234567890abcdef0"
]
}
],
"ScheduleExpression": "cron(0 00 12 ? * SUN *)",
"AssociationName": "UpdateSSMAgent"
}
]
}
Loading

0 comments on commit c4f0988

Please sign in to comment.