Associates a Route 53 Profiles profile with a VPC. A VPC can have up to two Profile associations. A Profile can be associated with up to 1,000 VPCs, and you can request a higher quota for the number of VPCs. For more information, see Quotas on Route 53 Profiles.
Route 53 VPC Resolver evaluates the Profile associations for a VPC in priority order, starting with the lowest Priority value. If the VPC has no other Profile associations, you can omit Priority, and the association gets priority 100. When the VPC already has a Profile association, you must specify a Priority, and each Profile association for the VPC must have a unique priority. To change the priority of an existing association, use UpdateProfileAssociation.
The request fails with a ValidationException in these cases:
-
You omit Priority, and the VPC already has a Profile association.
-
Another Profile association for the VPC already uses the priority that you specify.
-
The priority is outside the range 100–9900.
-
The Profile is already associated with the VPC, and you specify a different Name or Priority. To change the priority, use UpdateProfileAssociation.
The request fails with a LimitExceededException if the VPC already has the maximum number of Profile associations.
Parameters:
-
profile_id
(ResourceId)
–
-
resource_id
(ResourceId)
–
-
name
(Name)
–
A name for the association.
-
tags
(Optional[TagList], default:
None
)
–
A list of the tag keys and values that you want to identify the Profile association.
-
priority
(Optional[Priority], default:
None
)
–
The priority of the Profile association. Route 53 VPC Resolver evaluates the Profile associations for a VPC in priority order, starting with the lowest value.
When the VPC already has a Profile association, you must specify a priority that no other Profile association for the VPC uses. If you omit the priority for the first association with a VPC, the association gets priority 100.
Raises:
Source code in docs_src/capo_route53profiles/_services/async_route53_profiles.py
| async def associate_profile(
self,
profile_id: "capo_route53profiles.types.resource_id.ResourceId",
resource_id: "capo_route53profiles.types.resource_id.ResourceId",
name: "capo_route53profiles.types.name.Name",
*,
config_overrides: Optional[AsyncRoute53ProfilesClientConfig] = None,
tags: Optional["capo_route53profiles.types.tag_list.TagList"] = None,
priority: Optional["capo_route53profiles.types.priority.Priority"] = None,
) -> (
"capo_route53profiles.types.associate_profile_response.AssociateProfileResponse"
):
"""<p> Associates a Route 53 Profiles profile with a VPC. A VPC can have up to two Profile associations. A Profile can be associated with up to 1,000 VPCs, and you can request a higher quota for the number of VPCs. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html#limits-api-entities-route53-profiles">Quotas on Route 53 Profiles</a>. </p> <p> Route 53 VPC Resolver evaluates the Profile associations for a VPC in priority order, starting with the lowest <code>Priority</code> value. If the VPC has no other Profile associations, you can omit <code>Priority</code>, and the association gets priority 100. When the VPC already has a Profile association, you must specify a <code>Priority</code>, and each Profile association for the VPC must have a unique priority. To change the priority of an existing association, use <code>UpdateProfileAssociation</code>. </p> <p>The request fails with a <code>ValidationException</code> in these cases:</p> <ul> <li> <p>You omit <code>Priority</code>, and the VPC already has a Profile association.</p> </li> <li> <p>Another Profile association for the VPC already uses the priority that you specify.</p> </li> <li> <p>The priority is outside the range 100–9900.</p> </li> <li> <p>The Profile is already associated with the VPC, and you specify a different <code>Name</code> or <code>Priority</code>. To change the priority, use <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53profiles_UpdateProfileAssociation.html">UpdateProfileAssociation</a>.</p> </li> </ul> <p> The request fails with a <code>LimitExceededException</code> if the VPC already has the maximum number of Profile associations. </p>
Args:
profile_id: <p> ID of the Profile. </p>
resource_id: <p> The ID of the VPC. </p>
name: <p> A name for the association. </p>
tags: <p> A list of the tag keys and values that you want to identify the Profile association. </p>
priority: <p> The priority of the Profile association. Route 53 VPC Resolver evaluates the Profile associations for a VPC in priority order, starting with the lowest value. </p> <p> When the VPC already has a Profile association, you must specify a priority that no other Profile association for the VPC uses. If you omit the priority for the first association with a VPC, the association gets priority 100. </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.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_exists_exception.ResourceExistsException: <p> The resource you are trying to associate, has already been associated. </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_profile_request.AssociateProfileRequest]",
) -> AsyncOperationResponse[
"capo_route53profiles.types.associate_profile_response.AssociateProfileResponse"
]:
import capo_route53profiles._operations.route53_profiles.associate_profile
(
output,
http_response,
) = await capo_route53profiles._operations.route53_profiles.associate_profile.async_associate_profile(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateProfile")
)
input_: capo_route53profiles.types.associate_profile_request.AssociateProfileRequest = {
"profile_id": profile_id,
"resource_id": resource_id,
"name": name,
}
if tags is not None:
input_["tags"] = tags
if priority is not None:
input_["priority"] = priority
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|