Skip to content

create_network_insights_access_scope async

create_network_insights_access_scope(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    match_paths: Optional[AccessScopePathListRequest] = None,
    exclude_paths: Optional[AccessScopePathListRequest] = None,
    client_token: Optional[String] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
    dry_run: Optional[Boolean] = None,
) -> CreateNetworkInsightsAccessScopeResult

Creates a Network Access Scope.

Amazon Web Services Network Access Analyzer enables cloud networking and cloud operations teams to verify that their networks on Amazon Web Services conform to their network security and governance objectives. For more information, see the Amazon Web Services Network Access Analyzer Guide.

Parameters:

  • match_paths (Optional[AccessScopePathListRequest], default: None ) –

    The paths to match.

  • exclude_paths (Optional[AccessScopePathListRequest], default: None ) –

    The paths to exclude.

  • client_token (Optional[String], default: None ) –

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to ensure idempotency.

  • tag_specifications (Optional[TagSpecificationList], default: None ) –

    The tags to apply.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def create_network_insights_access_scope(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    match_paths: Optional[
        "capo_ec2.types.access_scope_path_list_request.AccessScopePathListRequest"
    ] = None,
    exclude_paths: Optional[
        "capo_ec2.types.access_scope_path_list_request.AccessScopePathListRequest"
    ] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
    tag_specifications: Optional[
        "capo_ec2.types.tag_specification_list.TagSpecificationList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.create_network_insights_access_scope_result.CreateNetworkInsightsAccessScopeResult":
    """<p>Creates a Network Access Scope.</p> <p>Amazon Web Services Network Access Analyzer enables cloud networking and cloud operations teams to verify that their networks on Amazon Web Services conform to their network security and governance objectives. For more information, see the <a href="https://docs.aws.amazon.com/vpc/latest/network-access-analyzer/">Amazon Web Services Network Access Analyzer Guide</a>.</p>

    Args:
        match_paths: <p>The paths to match.</p>
        exclude_paths: <p>The paths to exclude.</p>
        client_token: <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">How to ensure idempotency</a>.</p>
        tag_specifications: <p>The tags to apply.</p>
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.create_network_insights_access_scope_request.CreateNetworkInsightsAccessScopeRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.create_network_insights_access_scope_result.CreateNetworkInsightsAccessScopeResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_network_insights_access_scope

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.create_network_insights_access_scope.async_create_network_insights_access_scope(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateNetworkInsightsAccessScope")
    )
    input_: capo_ec2.types.create_network_insights_access_scope_request.CreateNetworkInsightsAccessScopeRequest = {}
    if match_paths is not None:
        input_["match_paths"] = match_paths
    if exclude_paths is not None:
        input_["exclude_paths"] = exclude_paths
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tag_specifications is not None:
        input_["tag_specifications"] = tag_specifications
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output