This documentation is for Version 1 of the Amazon CLI only. For documentation related to Version 2 of the Amazon CLI, see the Version 2 User Guide.
Route 53 Profiles examples using Amazon CLI
The following code examples show you how to perform actions and implement common scenarios by using the Amazon Command Line Interface with Route 53 Profiles.
Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.
Each example includes a link to the complete source code, where you can find instructions on how to set up and run the code in context.
Topics
Actions
The following code example shows how to use associate-profile.
- Amazon CLI
-
To associate a Profile
The following
associate-profileexample associates a Profile to a VPC.aws route53profiles associate-profile \ --nametest-association\ --profile-idrp-4987774726example\ --resource-idvpc-0af3b96b3exampleOutput:
{ "ProfileAssociation": { "CreationTime": 1710851336.527, "Id": "rpassoc-489ce212fexample", "ModificationTime": 1710851336.527, "Name": "test-association", "OwnerId": "123456789012", "ProfileId": "rp-4987774726example", "ResourceId": "vpc-0af3b96b3example", "Status": "CREATING", "StatusMessage": "Creating Profile Association" } }For more information, see Using Profiles
in the Amazon Route 53 Developer Guide. -
For API details, see AssociateProfile
in Amazon CLI Command Reference.
-
The following code example shows how to use associate-resource-to-profile.
- Amazon CLI
-
To associate a resource to a Profile
The following
associate-resource-to-profileexample associates a DNS Firewall rule group with the priority of 102 to a Profile.aws route53profiles associate-resource-to-profile \ --nametest-resource-association\ --profile-idrp-4987774726example\ --resource-arnarn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example\ --resource-properties "{\"priority\": 102}"Output:
{ "ProfileResourceAssociation": { "CreationTime": 1710851216.613, "Id": "rpr-001913120a7example", "ModificationTime": 1710851216.613, "Name": "test-resource-association", "OwnerId": "123456789012", "ProfileId": "rp-4987774726example", "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example", "ResourceProperties": "{\"priority\":102}", "ResourceType": "FIREWALL_RULE_GROUP", "Status": "UPDATING", "StatusMessage": "Updating the Profile to DNS Firewall rule group association" } }-
For API details, see AssociateResourceToProfile
in Amazon CLI Command Reference.
-
The following code example shows how to use create-profile.
- Amazon CLI
-
To create a Profile
The following
create-profileexample creates a Profile.aws route53profiles create-profile \ --nametestOutput:
{ "Profile": { "Arn": "arn:aws:route53profiles:us-east-1:123456789012:profile/rp-6ffe47d5example", "ClientToken": "2ca1a304-32b3-4f5f-bc4c-EXAMPLE11111", "CreationTime": 1710850903.578, "Id": "rp-6ffe47d5example", "ModificationTime": 1710850903.578, "Name": "test", "OwnerId": "123456789012", "ShareStatus": "NOT_SHARED", "Status": "COMPLETE", "StatusMessage": "Created Profile" } }-
For API details, see CreateProfile
in Amazon CLI Command Reference.
-
The following code example shows how to use delete-profile.
- Amazon CLI
-
To delete a Profile
The following
delete-profileexample deletes a Profile.aws route53profiles delete-profile \ --profile-idrp-6ffe47d5exampleOutput:
{ "Profile": { "Arn": "arn:aws:route53profiles:us-east-1:123456789012:profile/rp-6ffe47d5example", "ClientToken": "0a15fec0-05d9-4f78-bec0-EXAMPLE11111", "CreationTime": 1710850903.578, "Id": "rp-6ffe47d5example", "ModificationTime": 1710850903.578, "Name": "test", "OwnerId": "123456789012", "ShareStatus": "NOT_SHARED", "Status": "DELETED", "StatusMessage": "Deleted Profile" } }-
For API details, see DeleteProfile
in Amazon CLI Command Reference.
-
The following code example shows how to use disassociate-profile.
- Amazon CLI
-
To disassociate a Profile
The following
disassociate-profileexample disassociates a Profile from a VPC.aws route53profiles disassociate-profile \ --profile-idrp-4987774726example\ --resource-idvpc-0af3b96b3exampleOutput:
{ "ProfileAssociation": { "CreationTime": 1710851336.527, "Id": "rpassoc-489ce212fexample", "ModificationTime": 1710851401.362, "Name": "test-association", "OwnerId": "123456789012", "ProfileId": "rp-4987774726example", "ResourceId": "vpc-0af3b96b3example", "Status": "DELETING", "StatusMessage": "Deleting Profile Association" } }-
For API details, see DisassociateProfile
in Amazon CLI Command Reference.
-
The following code example shows how to use disassociate-resource-from-profile.
- Amazon CLI
-
To disassociate a resource from Profile
The following
disassociate-resource-from-profileexample disassociates a DNS Firewall rule group from a Profile.aws route53profiles disassociate-resource-from-profile \ --profile-idrp-4987774726example\ --resource-arnarn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72exampleOutput:
{ "ProfileResourceAssociation": { "CreationTime": 1710851216.613, "Id": "rpr-001913120a7example", "ModificationTime": 1710852624.36, "Name": "test-resource-association", "OwnerId": "123456789012", "ProfileId": "rp-4987774726example", "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example", "ResourceProperties": "{\"priority\":105}", "ResourceType": "FIREWALL_RULE_GROUP", "Status": "DELETING", "StatusMessage": "Deleting the Profile to DNS Firewall rule group association" } }-
For API details, see DisassociateResourceFromProfile
in Amazon CLI Command Reference.
-
The following code example shows how to use get-profile-association.
- Amazon CLI
-
To get information about a Profile association
The following
get-profile-associationreturns information about the specified Profile association.aws route53profiles get-profile-association \ --profile-association-idrpassoc-489ce212fexampleOutput:
{ "ProfileAssociation": { "CreationTime": 1709338817.148, "Id": "rrpassoc-489ce212fexample", "ModificationTime": 1709338974.772, "Name": "test-association", "OwnerId": "123456789012", "ProfileId": "rp-4987774726example", "ResourceId": "vpc-0af3b96b3example", "Status": "COMPLETE", "StatusMessage": "Created Profile Association" } }-
For API details, see GetProfileAssociation
in Amazon CLI Command Reference.
-
The following code example shows how to use get-profile-resource-association.
- Amazon CLI
-
To get information about a resource associated to a Profile
The following
get-profile-resource-associationreturns information about the specified resource association to a Profile.aws route53profiles get-profile-resource-association \ --profile-resource-association-idrpr-001913120a7exampleOutput:
{ "ProfileResourceAssociation": { "CreationTime": 1710851216.613, "Id": "rpr-001913120a7example", "ModificationTime": 1710852303.798, "Name": "test-resource-association", "OwnerId": "123456789012", "ProfileId": "rp-4987774726example", "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example", "ResourceProperties": "{\"priority\":105}", "ResourceType": "FIREWALL_RULE_GROUP", "Status": "COMPLETE", "StatusMessage": "Completed creation of Profile to DNS Firewall rule group association" } }-
For API details, see GetProfileResourceAssociation
in Amazon CLI Command Reference.
-
The following code example shows how to use get-profile.
- Amazon CLI
-
To get information about a Profile
The following
get-profilereturns information about the specified Profile.aws route53profiles get-profile \ --profile-idrp-4987774726exampleOutput:
{ "Profile": { "Arn": "arn:aws:route53profiles:us-east-1:123456789012:profile/rp-4987774726example", "ClientToken": "0cbc5ae7-4921-4204-bea9-EXAMPLE11111", "CreationTime": 1710851044.288, "Id": "rp-4987774726example", "ModificationTime": 1710851044.288, "Name": "test", "OwnerId": "123456789012", "ShareStatus": "NOT_SHARED", "Status": "COMPLETE", "StatusMessage": "Created Profile" } }-
For API details, see GetProfile
in Amazon CLI Command Reference.
-
The following code example shows how to use list-profile-associations.
- Amazon CLI
-
To list Profile associations
The following
list-profile-associationslists the Profile associations in your Amazon account.aws route53profiles list-profile-associationsOutput:
{ "ProfileAssociations": [ { "CreationTime": 1709338817.148, "Id": "rpassoc-489ce212fexample", "ModificationTime": 1709338974.772, "Name": "test-association", "OwnerId": "123456789012", "ProfileId": "rp-4987774726example", "ResourceId": "vpc-0af3b96b3example", "Status": "COMPLETE", "StatusMessage": "Created Profile Association" } ] }-
For API details, see ListProfileAssociations
in Amazon CLI Command Reference.
-
The following code example shows how to use list-profile-resource-associations.
- Amazon CLI
-
To list Profile resource associations
The following
list-profile-resource-associationslist the Profile resource associations for the specified Profile.aws route53profiles list-profile-resource-associations \ --profile-idrp-4987774726exampleOutput:
{ "ProfileResourceAssociations": [ { "CreationTime": 1710851216.613, "Id": "rpr-001913120a7example", "ModificationTime": 1710851216.613, "Name": "test-resource-association", "OwnerId": "123456789012", "ProfileId": "rp-4987774726example", "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example", "ResourceProperties": "{\"priority\":102}", "ResourceType": "FIREWALL_RULE_GROUP", "Status": "COMPLETE", "StatusMessage": "Completed creation of Profile to DNS Firewall rule group association" } ] }-
For API details, see ListProfileResourceAssociations
in Amazon CLI Command Reference.
-
The following code example shows how to use list-profiles.
- Amazon CLI
-
To list Profiles
The following
list-profileslists the Profiles in your Amazon account and displays additional information about them.aws route53profiles list-profilesOutput:
{ "ProfileSummaries": [ { "Arn": "arn:aws:route53profiles:us-east-1:123456789012:profile/rp-4987774726example", "Id": "rp-4987774726example", "Name": "test", "ShareStatus": "NOT_SHARED" } ] }-
For API details, see ListProfiles
in Amazon CLI Command Reference.
-
The following code example shows how to use list-tags-for-resource.
- Amazon CLI
-
To list tags for a resource
The following
list-tags-for-resourcelists tags for the specified resource.aws route53profiles list-tags-for-resource \ --resource-arnarn:aws:route53profiles:us-east-1:123456789012:profile/rp-4987774726exampleOutput:
{ "Tags": { "my-key-2": "my-value-2", "my-key-1": "my-value-1" } }-
For API details, see ListTagsForResource
in Amazon CLI Command Reference.
-
The following code example shows how to use update-profile-resource-association.
- Amazon CLI
-
To update a resource associated to a Profile
The following
update-profile-resource-associationupdates a priority of a DNS Firewall rule group that is associated to the Profile.aws route53profiles update-profile-resource-association \ --profile-resource-association-idrpr-001913120a7example\ --resource-properties "{\"priority\": 105}"Output:
{ "ProfileResourceAssociation": { "CreationTime": 1710851216.613, "Id": "rpr-001913120a7example", "ModificationTime": 1710852303.798, "Name": "test-resource-association", "OwnerId": "123456789012", "ProfileId": "rp-4987774726example", "ResourceArn": "arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example", "ResourceProperties": "{\"priority\":105}", "ResourceType": "FIREWALL_RULE_GROUP", "Status": "UPDATING", "StatusMessage": "Updating the Profile to DNS Firewall rule group association" } }-
For API details, see UpdateProfileResourceAssociation
in Amazon CLI Command Reference.
-