-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9086 from elysahall/awsdocs-11-19-24
CLI examples cloudtrail, ec2, ecs, macie2
- Loading branch information
Showing
12 changed files
with
501 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,35 @@ | ||
**To create and configure AWS resources for a trail** | ||
|
||
The following ``create-subscription`` command creates a new S3 bucket and SNS topic for ``Trail1``:: | ||
The following ``create-subscription`` command creates a new S3 bucket and SNS topic for ``Trail1``. :: | ||
|
||
aws cloudtrail create-subscription --name Trail1 --s3-new-bucket my-bucket --sns-new-topic my-topic | ||
aws cloudtrail create-subscription \ | ||
--name Trail1 \ | ||
--s3-new-bucket amzn-s3-demo-bucket \ | ||
--sns-new-topic my-topic | ||
|
||
Output:: | ||
|
||
Setting up new S3 bucket my-bucket... | ||
Setting up new SNS topic my-topic... | ||
Creating/updating CloudTrail configuration... | ||
CloudTrail configuration: | ||
{ | ||
"trailList": [ | ||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail1", | ||
"TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": false, | ||
"S3BucketName": "my-bucket", | ||
"SnsTopicName": "my-topic", | ||
"HomeRegion": "us-east-1" | ||
} | ||
], | ||
"ResponseMetadata": { | ||
"HTTPStatusCode": 200, | ||
"RequestId": "f39e51f6-c615-11e5-85bd-d35ca21ee3e2" | ||
} | ||
} | ||
Starting CloudTrail service... | ||
Logs will be delivered to my-bucket | ||
Setting up new S3 bucket amzn-s3-demo-bucket... | ||
Setting up new SNS topic my-topic... | ||
Creating/updating CloudTrail configuration... | ||
CloudTrail configuration: | ||
{ | ||
"trailList": [ | ||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail1", | ||
"TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": false, | ||
"S3BucketName": "amzn-s3-demo-bucket", | ||
"SnsTopicName": "my-topic", | ||
"HomeRegion": "us-east-1" | ||
} | ||
], | ||
"ResponseMetadata": { | ||
"HTTPStatusCode": 200, | ||
"RequestId": "f39e51f6-c615-11e5-85bd-d35ca21ee3e2" | ||
} | ||
} | ||
Starting CloudTrail service... | ||
Logs will be delivered to my-bucket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
**To create a trail** | ||
|
||
The following ``create-trail`` command creates a multi-region trail named ``Trail1`` and specifies an S3 bucket:: | ||
The following ``create-trail`` example creates a multi-region trail named ``Trail1`` and specifies an S3 bucket. :: | ||
|
||
aws cloudtrail create-trail --name Trail1 --s3-bucket-name my-bucket --is-multi-region-trail | ||
aws cloudtrail create-trail \ | ||
--name Trail1 \ | ||
--s3-bucket-name amzn-s3-demo-bucket \ | ||
--is-multi-region-trail | ||
|
||
Output:: | ||
|
||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail1", | ||
"TrailARN": "arn:aws:cloudtrail:us-west-2:123456789012:trail/Trail1", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": true, | ||
"S3BucketName": "my-bucket" | ||
} | ||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail1", | ||
"TrailARN": "arn:aws:cloudtrail:us-west-2:123456789012:trail/Trail1", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": true, | ||
"S3BucketName": "amzn-s3-demo-bucket" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
**To describe a trail** | ||
|
||
The following ``describe-trails`` command returns the settings for ``Trail1`` and ``Trail2``:: | ||
The following ``describe-trails`` example returns the settings for ``Trail1`` and ``Trail2``. :: | ||
|
||
aws cloudtrail describe-trails --trail-name-list Trail1 Trail2 | ||
aws cloudtrail describe-trails \ | ||
--trail-name-list Trail1 Trail2 | ||
|
||
Output:: | ||
|
||
{ | ||
"trailList": [ | ||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail1", | ||
"TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": false, | ||
"S3BucketName": "my-bucket", | ||
"CloudWatchLogsRoleArn": "arn:aws:iam::123456789012:role/CloudTrail_CloudWatchLogs_Role", | ||
"CloudWatchLogsLogGroupArn": "arn:aws:logs:us-east-1:123456789012:log-group:CloudTrail:*", | ||
"SnsTopicName": "my-topic", | ||
"HomeRegion": "us-east-1" | ||
}, | ||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail2", | ||
"S3KeyPrefix": "my-prefix", | ||
"TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail2", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": false, | ||
"S3BucketName": "my-bucket", | ||
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/4c5ae5ac-3c13-421e-8335-c7868ef6a769", | ||
"HomeRegion": "us-east-1" | ||
} | ||
] | ||
} | ||
{ | ||
"trailList": [ | ||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail1", | ||
"TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": false, | ||
"S3BucketName": "amzn-s3-demo-bucket", | ||
"CloudWatchLogsRoleArn": "arn:aws:iam::123456789012:role/CloudTrail_CloudWatchLogs_Role", | ||
"CloudWatchLogsLogGroupArn": "arn:aws:logs:us-east-1:123456789012:log-group:CloudTrail:*", | ||
"SnsTopicName": "my-topic", | ||
"HomeRegion": "us-east-1" | ||
}, | ||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail2", | ||
"S3KeyPrefix": "my-prefix", | ||
"TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail2", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": false, | ||
"S3BucketName": "amzn-s3-demo-bucket2", | ||
"KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/4c5ae5ac-3c13-421e-8335-c7868ef6a769", | ||
"HomeRegion": "us-east-1" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
**To update the configuration settings for a trail** | ||
|
||
The following ``update-subscription`` command updates the trail to specify a new S3 bucket and SNS topic:: | ||
The following ``update-subscription`` example updates the trail to specify a new S3 bucket and SNS topic. :: | ||
|
||
aws cloudtrail update-subscription --name Trail1 --s3-new-bucket my-bucket-new --sns-new-topic my-topic-new | ||
aws cloudtrail update-subscription \ | ||
--name Trail1 \ | ||
--s3-new-bucket amzn-s3-demo-bucket \ | ||
--sns-new-topic my-topic-new | ||
|
||
Output:: | ||
|
||
Setting up new S3 bucket my-bucket-new... | ||
Setting up new SNS topic my-topic-new... | ||
Creating/updating CloudTrail configuration... | ||
CloudTrail configuration: | ||
{ | ||
"trailList": [ | ||
Setting up new S3 bucket amzn-s3-demo-bucket... | ||
Setting up new SNS topic my-topic-new... | ||
Creating/updating CloudTrail configuration... | ||
CloudTrail configuration: | ||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail1", | ||
"TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": false, | ||
"S3BucketName": "my-bucket-new", | ||
"SnsTopicName": "my-topic-new", | ||
"HomeRegion": "us-east-1" | ||
"trailList": [ | ||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail1", | ||
"TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": false, | ||
"S3BucketName": "amzn-s3-demo-bucket", | ||
"SnsTopicName": "my-topic-new", | ||
"HomeRegion": "us-east-1" | ||
} | ||
], | ||
"ResponseMetadata": { | ||
"HTTPStatusCode": 200, | ||
"RequestId": "31126f8a-c616-11e5-9cc6-2fd637936879" | ||
} | ||
} | ||
], | ||
"ResponseMetadata": { | ||
"HTTPStatusCode": 200, | ||
"RequestId": "31126f8a-c616-11e5-9cc6-2fd637936879" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
**To update a trail** | ||
|
||
The following ``update-trail`` command updates a trail to use an existing bucket for log delivery:: | ||
The following ``update-trail`` example updates a trail to use an existing bucket for log delivery. :: | ||
|
||
aws cloudtrail update-trail --name Trail1 --s3-bucket-name my-bucket | ||
aws cloudtrail update-trail \ | ||
--name Trail1 \ | ||
--s3-bucket-name amzn-s3-demo-bucket | ||
|
||
Output:: | ||
|
||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail1", | ||
"TrailARN": "arn:aws:cloudtrail:us-west-2:123456789012:trail/Trail1", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": true, | ||
"S3BucketName": "my-bucket" | ||
} | ||
{ | ||
"IncludeGlobalServiceEvents": true, | ||
"Name": "Trail1", | ||
"TrailARN": "arn:aws:cloudtrail:us-west-2:123456789012:trail/Trail1", | ||
"LogFileValidationEnabled": false, | ||
"IsMultiRegionTrail": true, | ||
"S3BucketName": "amzn-s3-demo-bucket" | ||
} |
Oops, something went wrong.