Testing in a sandbox for the AWS Partner Central Account API
How to use the sandbox
To use the sandbox, complete the following steps:
-
Create an IAM role:
Create an IAM role in the AWS account linked with your AWS Partner Central account.
-
Assign Policy:
Assign the following policy to the IAM role. For more information, see Adding and removing IAM identity permissions.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AccountManagement", "Effect": "Allow", "Action": [ "partnercentral:AcceptConnectionInvitation", "partnercentral:AssociateAwsTrainingCertificationEmailDomain", "partnercentral:CancelConnection", "partnercentral:CancelConnectionInvitation", "partnercentral:CancelProfileUpdateTask", "partnercentral:CreateConnectionInvitation", "partnercentral:CreatePartner", "partnercentral:DisassociateAwsTrainingCertificationEmailDomain", "partnercentral:GetAllianceLeadContact", "partnercentral:GetConnection", "partnercentral:GetConnectionInvitation", "partnercentral:GetConnectionPreferences", "partnercentral:GetPartner", "partnercentral:GetProfileUpdateTask", "partnercentral:GetProfileVisibility", "partnercentral:GetVerification", "partnercentral:ListConnectionInvitations", "partnercentral:ListConnections", "partnercentral:ListPartners", "partnercentral:PutAllianceLeadContact", "partnercentral:PutProfileVisibility", "partnercentral:RejectConnectionInvitation", "partnercentral:SendEmailVerificationCode", "partnercentral:StartProfileUpdateTask", "partnercentral:StartVerification", "partnercentral:UpdateConnectionPreferences" ], "Resource": "*", "Condition": { "StringEquals": { "partnercentral:Catalog": [ "Sandbox" ] } } }, { "Sid": "TaggingAccess", "Effect": "Allow", "Action": [ "partnercentral:TagResource", "partnercentral:UntagResource", "partnercentral:ListTagsForResource" ], "Resource": [ "arn:aws:partnercentral:*:*:catalog/Sandbox/partner/*" ], "Condition": { "StringEquals": { "partnercentral:Catalog": [ "Sandbox" ] } } } ] } -
Use IAM role credentials:
Use the credentials (secret key and access key) of this IAM role in your solution to perform the API actions.
Testing AWS actions
During the testing phase, it is often necessary to simulate AWS actions. This simulation enables partners to thoroughly test the complete end-to-end flow of their integration with AWS services. Each request includes a catalog parameter, which determines the data environment.
Simulating the creation of a Partner
To simulate the creation of a Partner, in the payload of the
CreatePartner action, include "catalog": "Sandbox" in the payload.
For example:
{ "ClientToken": "client-generated-uuid", "Catalog": "Sandbox", "LegalName": "Your Name", "PrimarySolutionType": "SOLUTION_TYPE", "AllianceLeadContact": { "FirstName": "Example First Name", "LastName": "Example Last Name", "BusinessTitle": "Example Title", "Email": "example@domain.com" }, "EmailVerificationCode": "123456" }
Note: In Sandbox email verification is disabled. You can use any six-digit EmailVerificationCode for testing. Also, don't use "Tags" in the request.
Additional testing notes
-
To test other actions, set
"catalog": "Sandbox"in the payload. -
To test partner account connections in sandbox, you must execute
StartProfileUpdateTaskaction after creating partner in sandbox catalog. -
To move to production, change the catalog value from
SandboxtoAWS.
Testing events in the sandbox environment
Partners can consume events from the sandbox environment to help test the event-based implementations. Set up EventBridge in the same AWS account with rules to listen for sandbox events by specifying catalog: Sandbox in the event details. For more information, see Account API Events.
Example event rule:
{ "source": ["aws.partnercentral-account"], "detail": { "catalog": ["Sandbox"] } }
Event rules that specify catalog as Sandbox will only match
events coming from the sandbox, generated by the actions you perform in the sandbox
environment.