create_scope
async
¶
create_scope(
scope_name: ScopeName,
scope_configuration: ScopeConfiguration,
*,
config_overrides: Optional[AsyncNetworkSecurityManagerClientConfig] = None,
client_token: Optional[IdempotencyToken] = None,
scope_description: Optional[Description] = None,
specialized_scope_type: Optional[SpecializedScopeType] = None,
is_published: Optional[IsPublished] = None,
tags: Optional[TagMap] = None,
) -> CreateScopeOutput
Creates a scope. A scope selects the accounts and resources that a deployment applies to. Use isPublished to create the scope in published (ACTIVE) or draft (DRAFT) state.
Parameters:
-
client_token(Optional[IdempotencyToken], default:None) –A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.
-
scope_name(ScopeName) –The name of the scope.
-
scope_description(Optional[Description], default:None) –A description of the scope.
-
scope_configuration(ScopeConfiguration) –The configuration that defines which accounts and resources are in scope.
-
specialized_scope_type(Optional[SpecializedScopeType], default:None) –The specialized type of the scope. Omit this value to create a standard scope that you can associate with a deployment. Set it to create a scope that is built for one specific purpose: a specialized scope can be used only for the purpose that its type defines, is validated against that use, and can't be associated with a deployment. This value is set when the scope is created and can't be changed.
-
is_published(Optional[IsPublished], default:None) –Specifies whether to publish the resource. When
true, the resource is saved in published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT). Default:true. -
tags(Optional[TagMap], default:None) –The tags to add to the resource when it is created.
Raises:
-
AccessDeniedException–You do not have sufficient permissions to perform this action.
-
ConflictException–The request conflicts with the current state of the resource. For example, the resource was modified concurrently, or it is in a state that does not allow the requested operation.
-
InternalServerException–The request processing failed because of an internal error in the service. This is a retryable error.
-
ServiceQuotaExceededException–The request would exceed a service quota.
-
ServiceUnavailableException–The service is temporarily unavailable. This is a retryable error.
-
TagPolicyViolationException–The request violates a tag policy that is in effect for the account or organization.
-
ThrottlingException–The request was denied because of request throttling. Reduce your request rate and try again.
-
ValidationException–The request failed validation. For details, see the
reasonandfieldListmembers of the response. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create a scope Creates a new scope in published (ACTIVE) state.
>>> await client.create_scope(client_token='550e8400-e29b-41d4-a716-446655440001', scope_name='production-web-apps', scope_description='Scope covering all production web application resources', scope_configuration={'accountFilter': {'includeAll': {}}, 'resourceScopes': {}}, is_published=True)
Source code in docs_src/capo_network_security_manager/_services/async_network_security_manager.py
3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 | |