Skip to content

Commit

Permalink
[OSD-21099] Updated opt-In region doc
Browse files Browse the repository at this point in the history
  • Loading branch information
reedcort committed Apr 29, 2024
1 parent 4ed85c4 commit 562da37
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/9.0-Opt-In-Regions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 9.0 Opt-In Regions

Content:

- [9.0 Opt-In Regions](#90-opt-in-regions)
- [Where are Opt-In Regionss defined?](#where-are-opt-in-regions-defined)
- [How are Service Quotas applied to an AccountPool?](#how-are-service-quotas-applied-to-an-accountpool)
- [So our new Account has service quotas defined, now what?](#so-our-new-account-has-service-quotas-defined-now-what)
- [Batch, batch, batch](#batch-batch-batch)

## Where are Opt-In Regions defined?
AAO now supports AWS opt-in regions for non-CCS accounts, both for new and existing accounts. This new feature is hidden behind a feature flag, which is set in the AAO ConfigMap. Along with this, the 'opt-regions' key is used to specify opt-in regions, example:
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-account-operator-configmap
namespace: aws-account-operator
data:
account-limit: "1234"
feature.opt_in_regions: "true"
opt-in-regions: af-south-1,ap-southeast-4,ap-east-1,ap-southeast-3,eu-south-2
```
## So our new Account has AWS opted-in regions defined, now what?
Our new `Account` CR should reconcile as normal once it reaches the 'Creating' state. At this point, the state will transition to the `OptingInRegions` state. `OptingInRegions` encapsulates two sets of requests to AWS:
1. Checking the status of the region.
2. Enabling the opt-in regions defined in the AAO ConfigMap.

To track the state of our region enablement requests between reconciles, we load the region status into the Account CR status and example:
```yaml
status:
optInRegions:
af-south-1:
status: ENABLED
ap-east-1:
status: ENABLING
ap-southeast-3:
status: TODO
ap-southeast-4:
status: ENABLING
eu-south-2:
status: ENABLING
```

## How to enable opted-in regions for existing ready accounts?
Begin by updating the AAO ConfigMap and then restarting the `aws-account-operator` pod. Upon the update, the `account_validation_controller.go` will iterate over all Ready accounts and verify that regions specified in the ConfigMap are enabled for account using the `ValidateOptInRegions` function: [] #TODO

## Batch, batch, batch
AWS imposes a maximum limit of 6 regions that can be concurrently enabled on a given account and a maximum limit of 9 accounts that can enable regions simultaneously. To circumvent these limits imposed by AWS, we batch the enablement requests. [Here](link to code) is the link to the code.

0 comments on commit 562da37

Please sign in to comment.