-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Java V2 Add examples for Control Tower #7668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
scmacdon
wants to merge
4
commits into
awsdocs:main
Choose a base branch
from
scmacdon:controltower
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,237
−0
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| # AWS Control Tower code examples for the SDK for Java 2.x | ||
|
|
||
| ## Overview | ||
|
|
||
| Shows how to use the AWS SDK for Java 2.x to work with AWS Control Tower. | ||
|
|
||
| <!--custom.overview.start--> | ||
| <!--custom.overview.end--> | ||
|
|
||
| _AWS Control Tower enables you to enforce and manage governance rules for security, operations, and compliance at scale across all your organizations and accounts._ | ||
|
|
||
| ## ⚠ Important | ||
|
|
||
| * Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/). | ||
| * Running the tests might result in charges to your AWS account. | ||
| * We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). | ||
| * This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). | ||
|
|
||
| <!--custom.important.start--> | ||
| <!--custom.important.end--> | ||
|
|
||
| ## Code examples | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| For prerequisites, see the [README](../../README.md#Prerequisites) in the `javav2` folder. | ||
|
|
||
|
|
||
| <!--custom.prerequisites.start--> | ||
| <!--custom.prerequisites.end--> | ||
|
|
||
| ### Get started | ||
|
|
||
| - [Hello AWS Control Tower](src/main/java/com/example/controltower/HelloControlTower.java#L28) (`ListBaselines`) | ||
|
|
||
|
|
||
| ### Basics | ||
|
|
||
| Code examples that show you how to perform the essential operations within a service. | ||
|
|
||
| - [Learn the basics](src/main/java/com/example/controltower/ControlTowerActions.java) | ||
|
|
||
|
|
||
| ### Single actions | ||
|
|
||
| Code excerpts that show you how to call individual service functions. | ||
|
|
||
| - [DisableBaseline](src/main/java/com/example/controltower/ControlTowerActions.java#L241) | ||
| - [DisableControl](src/main/java/com/example/controltower/ControlTowerActions.java#L431) | ||
| - [EnableBaseline](src/main/java/com/example/controltower/ControlTowerActions.java#L188) | ||
| - [EnableControl](src/main/java/com/example/controltower/ControlTowerActions.java#L377) | ||
| - [GetBaselineOperation](src/main/java/com/example/controltower/ControlTowerActions.java#L38) | ||
| - [GetControlOperation](src/main/java/com/example/controltower/ControlTowerActions.java#L474) | ||
| - [ListBaselines](src/main/java/com/example/controltower/ControlTowerActions.java#L88) | ||
| - [ListEnabledBaselines](src/main/java/com/example/controltower/ControlTowerActions.java#L138) | ||
| - [ListEnabledControls](src/main/java/com/example/controltower/ControlTowerActions.java#L324) | ||
| - [ListLandingZones](src/main/java/com/example/controltower/ControlTowerActions.java#L38) | ||
| - [ResetEnabledBaseline](src/main/java/com/example/controltower/ControlTowerActions.java#L548) | ||
|
|
||
|
|
||
| <!--custom.examples.start--> | ||
| <!--custom.examples.end--> | ||
|
|
||
| ## Run the examples | ||
|
|
||
| ### Instructions | ||
|
|
||
|
|
||
| <!--custom.instructions.start--> | ||
| <!--custom.instructions.end--> | ||
|
|
||
| #### Hello AWS Control Tower | ||
|
|
||
| This example shows you how to get started using AWS Control Tower. | ||
|
|
||
|
|
||
| #### Learn the basics | ||
|
|
||
| This example shows you how to do the following: | ||
|
|
||
| - List landing zones. | ||
| - List, enable, get, reset, and disable baselines. | ||
| - List, enable, get, and disable controls. | ||
|
|
||
| <!--custom.basic_prereqs.controltower_Scenario.start--> | ||
| <!--custom.basic_prereqs.controltower_Scenario.end--> | ||
|
|
||
|
|
||
| <!--custom.basics.controltower_Scenario.start--> | ||
| <!--custom.basics.controltower_Scenario.end--> | ||
|
|
||
|
|
||
| ### Tests | ||
|
|
||
| ⚠ Running tests might result in charges to your AWS account. | ||
|
|
||
|
|
||
| To find instructions for running these tests, see the [README](../../README.md#Tests) | ||
| in the `javav2` folder. | ||
|
|
||
|
|
||
|
|
||
| <!--custom.tests.start--> | ||
| <!--custom.tests.end--> | ||
|
|
||
| ## Additional resources | ||
|
|
||
| - [AWS Control Tower User Guide](https://docs.aws.amazon.com/controltower/latest/userguide/what-is-control-tower.html) | ||
| - [AWS Control Tower API Reference](https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) | ||
| - [SDK for Java 2.x AWS Control Tower reference](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/controltower/package-summary.html) | ||
|
|
||
| <!--custom.resources.start--> | ||
| <!--custom.resources.end--> | ||
|
|
||
| --- | ||
|
|
||
| Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect snippet name.