|
| 1 | +# AWS Control Tower code examples for the SDK for Java 2.x |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Shows how to use the AWS SDK for Java 2.x to work with AWS Control Tower. |
| 6 | + |
| 7 | +<!--custom.overview.start--> |
| 8 | +<!--custom.overview.end--> |
| 9 | + |
| 10 | +_AWS Control Tower enables you to enforce and manage governance rules for security, operations, and compliance at scale across all your organizations and accounts._ |
| 11 | + |
| 12 | +## ⚠ Important |
| 13 | + |
| 14 | +* 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/). |
| 15 | +* Running the tests might result in charges to your AWS account. |
| 16 | +* 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). |
| 17 | +* 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). |
| 18 | + |
| 19 | +<!--custom.important.start--> |
| 20 | +<!--custom.important.end--> |
| 21 | + |
| 22 | +## Code examples |
| 23 | + |
| 24 | +### Prerequisites |
| 25 | + |
| 26 | +For prerequisites, see the [README](../../README.md#Prerequisites) in the `javav2` folder. |
| 27 | + |
| 28 | + |
| 29 | +<!--custom.prerequisites.start--> |
| 30 | +<!--custom.prerequisites.end--> |
| 31 | + |
| 32 | +### Get started |
| 33 | + |
| 34 | +- [Hello AWS Control Tower](src/main/java/com/example/controltower/HelloControlTower.java#L27) (`ListBaselines`) |
| 35 | + |
| 36 | + |
| 37 | +### Basics |
| 38 | + |
| 39 | +Code examples that show you how to perform the essential operations within a service. |
| 40 | + |
| 41 | +- [Learn the basics](src/main/java/com/example/controltower/scenario/ControlTowerActions.java) |
| 42 | + |
| 43 | + |
| 44 | +### Single actions |
| 45 | + |
| 46 | +Code excerpts that show you how to call individual service functions. |
| 47 | + |
| 48 | +- [DisableBaseline](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L493) |
| 49 | +- [DisableControl](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L803) |
| 50 | +- [EnableBaseline](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L387) |
| 51 | +- [EnableControl](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L706) |
| 52 | +- [GetBaselineOperation](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L574) |
| 53 | +- [GetControlOperation](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L886) |
| 54 | +- [ListBaselines](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L257) |
| 55 | +- [ListEnabledBaselines](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L317) |
| 56 | +- [ListEnabledControls](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L638) |
| 57 | +- [ListLandingZones](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L204) |
| 58 | +- [ResetEnabledBaseline](src/main/java/com/example/controltower/scenario/ControlTowerActions.java#L986) |
| 59 | + |
| 60 | + |
| 61 | +<!--custom.examples.start--> |
| 62 | +<!--custom.examples.end--> |
| 63 | + |
| 64 | +## Run the examples |
| 65 | + |
| 66 | +### Instructions |
| 67 | + |
| 68 | + |
| 69 | +<!--custom.instructions.start--> |
| 70 | +<!--custom.instructions.end--> |
| 71 | + |
| 72 | +#### Hello AWS Control Tower |
| 73 | + |
| 74 | +This example shows you how to get started using AWS Control Tower. |
| 75 | + |
| 76 | + |
| 77 | +#### Learn the basics |
| 78 | + |
| 79 | +This example shows you how to do the following: |
| 80 | + |
| 81 | +- List landing zones. |
| 82 | +- List, enable, get, reset, and disable baselines. |
| 83 | +- List, enable, get, and disable controls. |
| 84 | + |
| 85 | +<!--custom.basic_prereqs.controltower_Scenario.start--> |
| 86 | +<!--custom.basic_prereqs.controltower_Scenario.end--> |
| 87 | + |
| 88 | + |
| 89 | +<!--custom.basics.controltower_Scenario.start--> |
| 90 | +<!--custom.basics.controltower_Scenario.end--> |
| 91 | + |
| 92 | + |
| 93 | +### Tests |
| 94 | + |
| 95 | +⚠ Running tests might result in charges to your AWS account. |
| 96 | + |
| 97 | + |
| 98 | +To find instructions for running these tests, see the [README](../../README.md#Tests) |
| 99 | +in the `javav2` folder. |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | +<!--custom.tests.start--> |
| 104 | +<!--custom.tests.end--> |
| 105 | + |
| 106 | +## Additional resources |
| 107 | + |
| 108 | +- [AWS Control Tower User Guide](https://docs.aws.amazon.com/controltower/latest/userguide/what-is-control-tower.html) |
| 109 | +- [AWS Control Tower API Reference](https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html) |
| 110 | +- [SDK for Java 2.x AWS Control Tower reference](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/controltower/package-summary.html) |
| 111 | + |
| 112 | +<!--custom.resources.start--> |
| 113 | +<!--custom.resources.end--> |
| 114 | + |
| 115 | +--- |
| 116 | + |
| 117 | +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 118 | + |
| 119 | +SPDX-License-Identifier: Apache-2.0 |
0 commit comments