View a markdown version of this page

CreateNetworkScope - AWS Network Manager

CreateNetworkScope

Creates a network scope for AWS Ops Agent for networking. A network scope defines the AWS accounts and Regions that AWS Ops Agent for networking analyzes.

The network scope starts in the PENDING state and moves to AVAILABLE when it's ready, or to FAILED if a prerequisite is missing. To associate accounts with it, call AssociateNetworkScopePrincipal.

Request Syntax

POST /network-scopes HTTP/1.1 Content-type: application/json { "AccessMode": "string", "ClientToken": "string", "Name": "string", "NetworkScopeRegions": [ "string" ], "Tags": [ { "Key": "string", "Value": "string" } ] }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

AccessMode

How the network scope admits principals. Each principal must be the ID of an AWS account that has the AWS Network Manager service-linked role. With ACCOUNTS, the account can be any AWS account. With ORGANIZATIONS, the account that owns the network scope must be the management account or a delegated administrator for AWS Network Manager in its organization, and each principal must be an active member account of that organization. A delegated administrator can't add the management account. You choose the access mode when you create the network scope, and you can't change it.

Type: String

Valid Values: ACCOUNTS | ORGANIZATIONS

Required: Yes

ClientToken

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry within 8 hours with the same client token and the same parameters, the operation returns the network scope that the first request created. If that network scope no longer exists, the operation returns ConflictException, and you need a new client token. If you reuse a client token with different parameters, the operation returns ValidationException. If you don't specify a client token, the AWS SDK generates one.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 256.

Pattern: [\s\S]*

Required: No

Name

The name of the network scope. The name can be up to 128 characters long and can contain letters, numbers, and spaces, as well as the following characters: . _ : / + = @ -

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [\s\S]*

Required: Yes

NetworkScopeRegions

The AWS Regions that the network scope covers. Each Region must be one where AWS Ops Agent for networking is available and can appear only once.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Length Constraints: Minimum length of 1. Maximum length of 63.

Pattern: [\s\S]*

Required: Yes

Tags

The tags to apply to the resource during creation.

Type: Array of Tag objects

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "NetworkScope": { "AccessMode": "string", "CreatedAt": number, "Name": "string", "NetworkScopeArn": "string", "NetworkScopeId": "string", "NetworkScopeRegions": [ "string" ], "State": "string", "StateReason": { "Code": "string", "Message": "string" } } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NetworkScope

Information about the network scope.

Type: NetworkScope object

Errors

For information about the errors that are common to all actions, see Common Error Types.

AccessDeniedException

You do not have sufficient access to perform this action.

ReasonCode

A prerequisite that you must complete before you retry the request. Only the network scope operations return this value. Branch on this value rather than on Message. These are the same codes that a network scope and a network scope principal carry in StateReason, so a prerequisite that is missing when you make the request and one that is found to be missing later are reported the same way.

HTTP Status Code: 403

ConflictException

There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.

ResourceId

The ID of the resource.

ResourceType

The resource type.

HTTP Status Code: 409

InternalServerException

The request has failed due to an internal error.

RetryAfterSeconds

Indicates when to retry the request.

HTTP Status Code: 500

ServiceQuotaExceededException

A service limit was exceeded.

LimitCode

The limit code.

Message

The error message.

ResourceId

The ID of the resource.

ResourceType

The resource type.

ServiceCode

The service code.

HTTP Status Code: 402

ThrottlingException

The request was denied due to request throttling.

RetryAfterSeconds

Indicates when to retry the request.

HTTP Status Code: 429

ValidationException

The input fails to satisfy the constraints.

Fields

The fields that caused the error, if applicable.

Reason

The reason for the error.

ReasonCode

A prerequisite that you must complete before you retry the request. Only the network scope operations return this value. Branch on this value rather than on Message. These are the same codes that a network scope and a network scope principal carry in StateReason, so a prerequisite that is missing when you make the request and one that is found to be missing later are reported the same way.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: