Skip to content

associate_resource_to_profile async

associate_resource_to_profile(
    profile_id: ResourceId,
    resource_arn: Arn,
    name: Name,
    *,
    config_overrides: Optional[AsyncRoute53ProfilesClientConfig] = None,
    resource_properties: Optional[ResourceProperties] = None,
) -> AssociateResourceToProfileResponse

Associates a DNS reource configuration to a Route 53 Profile.

Parameters:

  • profile_id (ResourceId) –

    ID of the Profile.

  • resource_arn (Arn) –

    Amazon resource number, ARN, of the DNS resource.

  • name (Name) –

    Name for the resource association.

  • resource_properties (Optional[ResourceProperties], default: None ) –

    If you are adding a DNS Firewall rule group, include also a priority. The priority indicates the processing order for the rule groups, starting with the priority assinged the lowest value.

    The allowed values for priority are between 100 and 9900.

Raises:

Source code in docs_src/capo_route53profiles/_services/async_route53_profiles.py
async def associate_resource_to_profile(
    self,
    profile_id: "capo_route53profiles.types.resource_id.ResourceId",
    resource_arn: "capo_route53profiles.types.arn.Arn",
    name: "capo_route53profiles.types.name.Name",
    *,
    config_overrides: Optional[AsyncRoute53ProfilesClientConfig] = None,
    resource_properties: Optional[
        "capo_route53profiles.types.resource_properties.ResourceProperties"
    ] = None,
) -> "capo_route53profiles.types.associate_resource_to_profile_response.AssociateResourceToProfileResponse":
    """<p> Associates a DNS reource configuration to a Route 53 Profile. </p>

    Args:
        profile_id: <p> ID of the Profile. </p>
        resource_arn: <p> Amazon resource number, ARN, of the DNS resource. </p>
        name: <p> Name for the resource association. </p>
        resource_properties: <p> If you are adding a DNS Firewall rule group, include also a priority. The priority indicates the processing order for the rule groups, starting with the priority assinged the lowest value. </p> <p>The allowed values for priority are between 100 and 9900.</p>

    Raises:
        capo_route53profiles.errors.access_denied_exception.AccessDeniedException: <p> The current account doesn't have the IAM permissions required to perform the specified operation. </p>
        capo_route53profiles.errors.conflict_exception.ConflictException: <p> The request you submitted conflicts with an existing request. </p>
        capo_route53profiles.errors.internal_service_error_exception.InternalServiceErrorException: <p> An internal server error occured. Retry your request. </p>
        capo_route53profiles.errors.invalid_parameter_exception.InvalidParameterException: <p> One or more parameters in this request are not valid. </p>
        capo_route53profiles.errors.limit_exceeded_exception.LimitExceededException: <p> The request caused one or more limits to be exceeded. </p>
        capo_route53profiles.errors.resource_not_found_exception.ResourceNotFoundException: <p> The resource you are associating is not found. </p>
        capo_route53profiles.errors.throttling_exception.ThrottlingException: <p> The request was throttled. Try again in a few minutes. </p>
        capo_route53profiles.errors.validation_exception.ValidationException: <p> You have provided an invalid command. </p>
        capo_route53profiles.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route53profiles.types.associate_resource_to_profile_request.AssociateResourceToProfileRequest]",
    ) -> AsyncOperationResponse[
        "capo_route53profiles.types.associate_resource_to_profile_response.AssociateResourceToProfileResponse"
    ]:
        import capo_route53profiles._operations.route53_profiles.associate_resource_to_profile

        (
            output,
            http_response,
        ) = await capo_route53profiles._operations.route53_profiles.associate_resource_to_profile.async_associate_resource_to_profile(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateResourceToProfile")
    )
    input_: capo_route53profiles.types.associate_resource_to_profile_request.AssociateResourceToProfileRequest = {
        "profile_id": profile_id,
        "resource_arn": resource_arn,
        "name": name,
    }
    if resource_properties is not None:
        input_["resource_properties"] = resource_properties

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