-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cross-account runbook + actions
- Loading branch information
svia3
committed
Dec 20, 2024
1 parent
f85ce9e
commit 5142ed4
Showing
3 changed files
with
102 additions
and
4 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
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
### Cross Account Setup | ||
In this scenario, we will use two accounts, a parent account hosting the DataZone domain, and a child account that contains | ||
a SageMaker Domain nd UserProfile that we would like to link, and import into the DataZone domain. Here AccountA is the parent | ||
account and AccountB is the child account. | ||
|
||
1. **[In the Parent Account]** Create a DataZone domain (make sure you are NOT using the Unified UI). It should say “Create a DataZone Domain”. | ||
2. **[In the Parent Account]** Create an association to the X-Account. | ||
|
||
- Click in to Domain - request Association by providing the the X-Account number. | ||
- This will create a AWSRAMPermissionDataZoneDefault policy to allow access from the X-account. | ||
- In the X-Account, Accept the resource Share in the DataZone UI (Unified UI) | ||
|
||
3. **[In the Parent Account]** Create A Project, select the parent domain as the “DomainUnit”. | ||
4. **[In the Parent Account]** Add in the X-account user that will access this project. | ||
|
||
- In the UserManagement tab, add the child user’s role (as an IAM user or SSO user) that requires access, from the X-account. Choose the AssociatedAccount option. | ||
- In the Projects tab, add the child user as a ProjectMember. They should be available in the DropDown menu. Set the respective permissions. | ||
|
||
> NOTE :: If this step (a.) is not done, the X-account user will see this error in their projects tab when clicking into the Assocated Domain | ||
``` | ||
Not a DataZone user | ||
You cannot view or create a project because you have not been added | ||
as a Amazon DataZone user. Please contact your domain admin to add | ||
your IAM role: arn:aws:iam::211125770549:role/Admin as a DataZone user. | ||
``` | ||
|
||
5. **[In the Child Account]** Create a SageMaker Domain. Ensure that you do this from the Amazon SageMaker AI console, not the Amazon SageMaker platform console (this is the unified experience, separate from this current workflow). Add users profiles to the domain | ||
6. **[In the Child Account]** Setup a federation role that will have permission to federate into our parent account’s Datazone portal. See `/resources` for examples of trust and permission policies. | ||
|
||
### Running the script | ||
For linking the SageMaker Domain + UserProfile using HULK BYOD Flow: | ||
|
||
Make sure that the current account you are using grants access to the X-account to sts:AssumeRole. | ||
For Example, AccountA is the one that houses the SageMaker Domain and UserProfile that you would like to import into the DataZone parent account, AccountB. | ||
|
||
* We need to be sure to add the following JSON to the TrustPolicy of the Admin (or whatever role in the parent account you’d like to assume, with DataZone permissions to call batch-put-linked-types and link the SageMaker Domain and UserProfiles). | ||
* Also, make sure to add the User that the current session is using. | ||
|
||
In the parent account (Account A), under the currently assumed role - we should add the following. | ||
This will allow our child account to assume parent account role during our current session, and link the SageMaker Domain + UserProfile that we interact with while running the script. | ||
|
||
``` | ||
{ | ||
"Sid": "", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": "arn:aws:sts::<Account_A>:assumed-role/Admin/<user>-Isengard" | ||
}, | ||
"Action": "sts:AssumeRole" | ||
} | ||
``` | ||
|
||
* Nothing changes with regards to the regular batch-put flow. We will assume the parent account (AccountA) credentials. | ||
* From the Parent Account, the script will call batch-put-linked type using the SageMaker ARN and SageMaker UserProfile ARN from the X-account (AccountB). | ||
* Federation link will then work for X-account and Parent Account from DZ portal → environment view. | ||
|
||
|
||
|
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