Working with network scopes
A network scope defines the accounts and Regions that AWS Ops Agent for networking analyzes. AWS Ops Agent creates and manages the network scope. You can view scopes and their principals, but you can't create, change, or delete them yourself.
Network scopes are part of the AWS Network Manager API. All eight network scope operations are published in the AWS Network Manager API Reference. This topic covers only the concepts and behavior that the API reference doesn't explain.
Concepts
- Network scope
A Regional resource. It lives in, and its ARN includes, the Region where it's created. The covered Regions (
NetworkScopeRegions) are separate and don't have to include the creation Region. A network scope also has a name, an access mode, a state, a state reason, and a creation time.- Principal
An account that is attached to a scope. Adding an OU or organization adds its member accounts as principals. A principal always covers all of the scope's Regions. The
PrincipalRegionsvalue is returned, not set, and changes when the scope's Regions change. A principal has a state and a state reason.- Access mode
Set when the scope is created, and immutable. In
ACCOUNTSmode, principals must be account IDs. InORGANIZATIONSmode, you specify the organization, OUs, or accounts in the caller's organization, and their member accounts become the principals; accounts that later join are added automatically by AWS Ops Agent for networking.
Who performs each operation
You perform the read operations. AWS Ops Agent performs the write operations, using your IAM identity when you add, change, or remove AWS Ops Agent for networking.
| Operation | Performed by |
|---|---|
ListNetworkScopes | You |
GetNetworkScope | You |
ListNetworkScopePrincipals | You |
CreateNetworkScope | AWS Ops Agent |
UpdateNetworkScope | AWS Ops Agent |
DeleteNetworkScope | AWS Ops Agent |
AssociateNetworkScopePrincipal | AWS Ops Agent |
DisassociateNetworkScopePrincipal | AWS Ops Agent |
View network scopes
You can view your network scopes and their principals with the AWS CLI. Network scope names start with devops-, followed by the account ID and the Agent Space ID.
aws networkmanager list-network-scopes aws networkmanager get-network-scope --network-scope-id <network-scope-id> aws networkmanager list-network-scope-principals --network-scope-id <network-scope-id>
The list operations support optional pagination parameters. list-network-scopes and list-network-scope-principals accept --max-results and --next-token. list-network-scope-principals also accepts --principals to filter the results by principal.
Network scope states
A network scope moves through the following states:
| State | Transitions to |
|---|---|
PENDING | AVAILABLE or FAILED |
AVAILABLE | UPDATING or DELETING |
UPDATING | AVAILABLE |
DELETING | DELETED or FAILED |
DELETED | Visible for 2 hours, and then it disappears. |
FAILED | DELETING. A failed scope can only be deleted. |
Retries keep the scope in PENDING or UPDATING. An organization refusal drives the scope to FAILED.
Only the AVAILABLE and FAILED states carry a state reason, one code at a time, in the following order: owner codes, network security analysis codes, and then PRINCIPALS_NOT_FULLY_COVERED.
Principal states
| State | Description and transitions |
|---|---|
ASSOCIATING | Transitions to ASSOCIATED or FAILED. |
ASSOCIATED | Can be partially covered, in which case it carries a reason and the scope shows PRINCIPALS_NOT_FULLY_COVERED. Transitions to DISASSOCIATING, INACTIVE, or FAILED. |
FAILED | Transitions to ASSOCIATED or DISASSOCIATING. |
INACTIVE | Suspended because the owner lost standing, the principal left the organization, the OU was deleted, or the AWS Network Manager delegated administrator lost access or changed. The principal returns to ASSOCIATING automatically only when the cause was an owner code or NOT_IN_OWNER_ORGANIZATION. When the cause is ORGANIZATIONAL_UNIT_DELETED, it is never restored; remove the OU from AWS Ops Agent for networking and add its accounts. Transitions to ASSOCIATING or DISASSOCIATING. If the cause isn't resolved, AWS Ops Agent for networking moves the principal to DISASSOCIATING and removes it from the network scope. |
DISASSOCIATING | Carries NETWORK_SECURITY_ANALYSIS_POLICY_MANAGEMENT_NOT_DELEGATED if the policy can't be detached. Then the principal is deleted. |
Recover from a failed scope
For a failed create, remove the Networking specialist (which deletes the scope), fix the cause, and add the Networking specialist again.
For a failed delete, fix the cause and remove the Networking specialist again.
If the owner account left the organization, the first delete ends
FAILEDand names the leftover policy. The next delete completes whether or not the policy was removed. Removing the policy is recommended cleanup from the old management account, not a prerequisite.
Quotas
Network scope quotas are Regional. States PENDING, AVAILABLE, UPDATING, DELETING, and FAILED count against a quota, but DELETED doesn't. Each account is a principal; an organization or OU contributes its member accounts, each counted as a principal. Exceeding a quota returns ServiceQuotaExceededException. For the quota values, see Quotas and limitations.
Related resources
For the network scope API operations, see the AWS Network Manager API Reference.
For the prerequisites to manage a network scope, see Getting started with AWS Ops Agent for networking.