Skip to content

Commit aac5017

Browse files
authored
Merge pull request #1471 from awsdocs/doug-update-gov2-readmes
Added readmes to all Go v2 code examples
2 parents 1cf714d + 9b7b284 commit aac5017

File tree

31 files changed

+276
-0
lines changed

31 files changed

+276
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### CreateCustomMetricv2.go
2+
3+
This example creates a new Amazon CloudWatch metric in a namespace.
4+
5+
`go run CreateCustomMetricv2.go -n NAMESPACE -m METRIC-NAME -s SECONDS -dn DIMENSION-NAME -dv DIMENSION-VALUE`
6+
7+
- _NAMESPACE_ is the namespace for the metric.
8+
- _METRIC-NAME_ is the name of the metric.
9+
- _SECONDS_ is the number of seconds for the metric.
10+
- _DIMENSION-NAME_ is the name of the dimension.
11+
- _DIMENSION-VALUE_ is the value of the dimension.
12+
13+
The unit test accepts similar values in _config.json_.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### CreateEnableMetricAlarmv2.go
2+
3+
This example enables the specified Amazon CloudWatch alarm.
4+
5+
`go run CreateEnableMetricAlarmv2.go -n INSTANCE-NAME -i INSTANCE-ID -a ALARM-NAME`
6+
7+
- _INSTANCE-NAME_ is the name of the Amazon Elastic Compute Cloud (Amazon EC2) instance for which the alarm is enabled.
8+
- _INSTANCE-ID_ is the ID of the Amazon EC2 instance for which the alarm is enabled.
9+
- _ALARM-NAME_ is the name of the alarm.
10+
11+
The unit test accepts similar values in _config.json_.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### DescribeAlarmsv2.go
2+
3+
This example displays a list of your Amazon CloudWatch alarms.
4+
5+
`go run DescribeAlarmsv2.go`
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### DisableAlarmv2.go
2+
3+
This example disables an Amazon CloudWatch alarm.
4+
5+
`go run DisableAlarmv2.go -a ALARM-NAME`
6+
7+
- _ALARM-NAME_ is the name of the alarm to disable.
8+
9+
The unit test accepts a similar value in _config.json_.

gov2/cloudwatch/ListMetrics/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### ListMetricsv2.go
2+
3+
This example displays the name, namespace, and dimension name of your Amazon CloudWatch metrics.
4+
5+
`go run ListMetricsv2.go`

gov2/cloudwatch/PutEvent/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### PutEventv2.go
2+
3+
This example sends an Amazon CloudWatch event to Amazon EventBridge.
4+
5+
`go run PutEventv2.go -l LAMBDA-ARN -f EVENT-FILE`
6+
7+
- _LAMBDA-ARN_ is the ARN of the AWS Lambda function of which the event is concerned.
8+
- _EVENT-FILE_ is the local file specifying details of the event to send to Amazon EventBridge.
9+
10+
The unit test accepts similar values in _config.json_.

gov2/dynamodb/DescribeTable/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### DescribeTable.go
2+
3+
This example lists the following properties of a DynamoDB table.
4+
5+
- Number of items
6+
- Size, in bytes
7+
- Status, such as Active
8+
9+
`go run DescribeTable.go -t TABLE`
10+
11+
- _TABLE_ is the name of the table.
12+
13+
The unit test accepts a similar value in _config.json_.

gov2/ec2/CreateImage/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### CreateImagev2.go
2+
3+
This example creates an Amazon EC2 image.
4+
5+
`go run CreateImagev2.go -d DESCRIPTION -i IMAGE-ID -n IMAGE-NAME`
6+
7+
- _DESCRIPTION_ is the description of the image.
8+
- _IMAGE-ID_ is the ID of the instance.
9+
- _IMAGE-NAME_ is the name of the image.
10+
11+
The unit test accepts similar values in _config.json_.

gov2/ec2/CreateInstance/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### CreateInstancev2.go
2+
3+
This example creates a T2-Micro instance from the Amazon EC2 image ami-e7527ed7 and attaches a tag to the instance.
4+
5+
`go run CreateInstancev2.go -n TAG-NAME -v TAG-VALUE`
6+
7+
- _TAG-NAME_ is the name of the tag to attach to the instance.
8+
- _TAG-VALUE_ is the value of the tag to attach to the instance.
9+
10+
The unit test accepts similar values in _config.json_.

gov2/ec2/DescribeInstances/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### DescribeInstancesv2.go
2+
3+
This example retrieves information about your Amazon EC2 instances.
4+
5+
`go run DescribeInstancesv2.go`

gov2/ec2/MonitorInstances/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### MonitorInstancesv2.go
2+
3+
This example enables or disables monitoring for an Amazon EC2 instance.
4+
5+
`go run MonitorInstancesv2.go -m MODE -i INSTANCE-ID`
6+
7+
- _MODE_ is either "OFF" to disable monitoring or "ON" to enable monitoring.
8+
- _INSTANCE-ID_ is the ID of the instance.
9+
10+
The unit test accepts similar values in _config.json_.

gov2/ec2/RebootInstances/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### RebootInstancesv2.go
2+
3+
This example reboots an Amazon EC2 instance.
4+
5+
`go run RebootInstancesv2.go -i INSTANCE-ID`
6+
7+
- _INSTANCE-ID_ is the ID of the instance to reboot.
8+
9+
The unit test accepts a similar value in _config.json_.

gov2/ec2/StartInstances/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### StartInstancesv2.go
2+
3+
This example starts an Amazon EC2 instance.
4+
5+
`go run StartInstancesv2.go -i INSTANCE-ID`
6+
7+
- _INSTANCE-ID_ is the ID of the instance to start.
8+
9+
The unit test accepts a similar value in _config.json_.

gov2/ec2/StopInstances/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### StopInstancesv2.go
2+
3+
This example stops an Amazon EC2 instance.
4+
5+
`go run StopInstancesv2.go -i INSTANCE-ID`
6+
7+
- _INSTANCE-ID_ is the ID of the instance to stop.
8+
9+
The unit test accepts a similar value in _config.json_.

gov2/s3/CopyObject/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### CopyObject.go
2+
3+
This example copies an Amazon S3 object from one bucket to another.
4+
5+
`go run CopyObject.go -s SOURCE -d DESTINATION -o OBJECT`
6+
7+
- _SOURCE_ is the name of the bucket containing the item to copy.
8+
- _DESTINATION_ is the name of the bucket to which the item is copied.
9+
- _OBJECT_ is the name of the object to copy.
10+
11+
The unit test accepts similar values in _config.json_.

gov2/s3/CreateBucket/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### CreateBucket.go
2+
3+
This example creates an Amazon S3 bucket.
4+
5+
`go run CreateBucket.go -b BUCKET`
6+
7+
- _BUCKET_ is the name of the bucket to create.
8+
9+
The unit test accepts a similar value in _config.json_.

gov2/s3/DeleteBucket/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### DeleteBucket.go
2+
3+
This example deletes an Amazon S3 bucket.
4+
5+
`go run DeleteBucket.go -b BUCKET`
6+
7+
- _BUCKET_ is the name of the bucket to delete.
8+
9+
The unit test accepts a similar value in _config.json_.

gov2/s3/DeleteObject/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### DeleteObject.go
2+
3+
This example deletes an Amazon S3 bucket object.
4+
5+
`go run DeleteObject.go -b BUCKET -o OBJECT`
6+
7+
- _BUCKET_ is the name of the bucket containing the item to delete.
8+
- _OBJECT_ is the name of the object to delete.
9+
10+
The unit test accepts similar values in _config.json_.

gov2/s3/GetBucketAcl/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### GetBucketAcl.go
2+
3+
This example retrieves the access control list (ACL) for an Amazon S3 bucket.
4+
5+
`go run GetBucketAcl.go -b BUCKET`
6+
7+
- _BUCKET_ is the name of the bucket for which the ACL is retrieved.
8+
9+
The unit test accepts a similar value in _config.json_.

gov2/s3/GetObjectAcl/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### GetObjectAcl.go
2+
3+
This example retrieves the access control list (ACL) for an Amazon S3 bucket object.
4+
5+
`go run GetObjectAcl.go -b BUCKET -o OBJECT`
6+
7+
- _BUCKET_ is the name of the bucket containing the item.
8+
- _OBJECT_ is the name of the object for which the ACL is retrieved.
9+
10+
The unit test accepts similar values in _config.json_.

gov2/s3/ListBuckets/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### ListBuckets.go
2+
3+
This example lists your Amazon S3 buckets.
4+
5+
`go run ListBuckets.go`

gov2/s3/ListObjects/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### ListObjects.go
2+
3+
This example lists the objects in an Amazon S3 bucket.
4+
5+
`go run ListObjects.go -b BUCKET`
6+
7+
- _BUCKET_ is the name of the bucket for which the objects are listed.
8+
9+
The unit test accepts a similar value in _config.json_.

gov2/s3/PutObject/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### PutObject.go
2+
3+
This example creates an Amazon S3 bucket object from a local file.
4+
5+
`go run PutObject.go -b BUCKET -f FILE`
6+
7+
- _BUCKET_ is the name of the bucket to which the file is uploaded.
8+
- _FILE_ is the name of the local file to upload.
9+
10+
The unit test accepts similar values in _config.json_.

gov2/sns/CreateTopic/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### CreateTopic.go
2+
3+
This example creates an Amazon SNS topic.
4+
5+
`go run CreateTopic.go -t TOPIC`
6+
7+
- _TOPIC_ is the name of the topic to create.
8+
9+
The unit test accepts a similar value in _config.json_.

gov2/sns/ListSubscriptions/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### ListSubscriptions.go
2+
3+
This example lists the topic and subscription Amazon Resource Names (ARNs) for your Amazon SNS subscriptions.
4+
5+
`go run ListSubscriptions.go`

gov2/sns/ListTopics/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### ListTopics.go
2+
3+
This example lists the ARNs for your Amazon SNS topics.
4+
5+
`go run ListTopics.go`

gov2/sns/Publish/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### Publish.go
2+
3+
This example publishes a message to an Amazon SNS topic.
4+
5+
`go run Publish.go -m MESSAGE -t TOPIC-ARN`
6+
7+
- _MESSAGE_ is the message to publish.
8+
- _TOPIC-ARN_ is the ARN of the topic to which the message is published.
9+
10+
The unit test accepts similar values in _config.json_.

gov2/sns/Subscribe/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### Subscribe.go
2+
3+
This example subscribes a user, by email address, to an Amazon SNS topic.
4+
5+
`go run Subscribe.go -m EMAIL-ADDRESS -t TOPIC-ARN`
6+
7+
- _EMAIL-ADDRESS_ is the email address of the user subscribing to the topic.
8+
- _TOPIC-ARN_ is the ARN of the topic.
9+
10+
The unit test accepts a similar value in _config.json_.

gov2/ssm/DeleteParameter/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### DeleteParameterv2.go
2+
3+
This example deletes a Systems Manager string parameter.
4+
5+
`go run DeleteParameterv2.go -n NAME`
6+
7+
- _NAME_ is the name of the parameter to delete.
8+
9+
The unit test accepts a similar value in _config.json_.

gov2/ssm/GetParameter/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### GetParameterv2.go
2+
3+
This example retrieves a Systems Manager string parameter.
4+
5+
`go run GetParameterv2.go -n NAME`
6+
7+
- _NAME_ is the name of the parameter to retrieve.

gov2/ssm/PutParameter/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
### PutParameterv2.go
2+
3+
This example creates a Systems Manager string parameter.
4+
5+
`go run PutParameterv2.go -n NAME -v VALUE`
6+
7+
- _NAME_ is the name of the parameter to create.
8+
- _VALUE_ is the value of the parameter to create.
9+
10+
The unit test accepts similar values in _config.json_.

0 commit comments

Comments
 (0)