를 사용한 Route 53 Profiles 예제 AWS CLI - AWS SDK 코드 예제

Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. AWS

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

를 사용한 Route 53 Profiles 예제 AWS CLI

다음 코드 예제에서는 Route 53 Profiles와 AWS Command Line Interface 함께를 사용하여 작업을 수행하고 일반적인 시나리오를 구현하는 방법을 보여줍니다.

작업은 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 작업은 관련 시나리오의 컨텍스트에 따라 표시되며, 개별 서비스 함수를 직접적으로 호출하는 방법을 보여줍니다.

각 예시에는 전체 소스 코드에 대한 링크가 포함되어 있으며, 여기에서 컨텍스트에 맞춰 코드를 설정하고 실행하는 방법에 대한 지침을 찾을 수 있습니다.

주제

작업

다음 코드 예시에서는 associate-profile의 사용 방법을 보여줍니다.

AWS CLI

프로파일 연결

다음 associate-profile 예시에서는 프로파일을 VPC에 연결합니다.

aws route53profiles associate-profile \ --name test-association \ --profile-id rp-4987774726example \ --resource-id vpc-0af3b96b3example

출력:

{ "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" } }

자세한 내용은 Amazon Route 53 개발자 안내서프로파일 사용을 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조AssociateProfile을 참조하세요.

다음 코드 예시에서는 associate-resource-to-profile의 사용 방법을 보여줍니다.

AWS CLI

리소스를 프로파일에 연결

다음 associate-resource-to-profile 예시에서는 우선순위가 102인 DNS 방화벽 규칙 그룹을 프로파일에 연결합니다.

aws route53profiles associate-resource-to-profile \ --name test-resource-association \ --profile-id rp-4987774726example \ --resource-arn arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example \ --resource-properties "{\"priority\": 102}"

출력:

{ "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" } }

다음 코드 예시에서는 create-profile의 사용 방법을 보여줍니다.

AWS CLI

프로파일 생성

다음 create-profile 예시에서는 프로파일을 생성합니다.

aws route53profiles create-profile \ --name test

출력:

{ "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" } }
  • API 세부 정보는 AWS CLI 명령 참조CreateProfile을 참조하세요.

다음 코드 예시에서는 delete-profile의 사용 방법을 보여줍니다.

AWS CLI

프로파일 삭제

다음 delete-profile 예시에서는 프로파일을 삭제합니다.

aws route53profiles delete-profile \ --profile-id rp-6ffe47d5example

출력:

{ "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" } }
  • API 세부 정보는 AWS CLI 명령 참조DeleteProfile을 참조하세요.

다음 코드 예시에서는 disassociate-profile의 사용 방법을 보여줍니다.

AWS CLI

프로파일 연결 해제

다음 disassociate-profile 예시에서는 VPC에서 프로파일의 연결을 해제합니다.

aws route53profiles disassociate-profile \ --profile-id rp-4987774726example \ --resource-id vpc-0af3b96b3example

출력:

{ "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" } }

다음 코드 예시에서는 disassociate-resource-from-profile의 사용 방법을 보여줍니다.

AWS CLI

프로파일에서 리소스 연결 해제

다음 disassociate-resource-from-profile 예시에서는 프로파일에서 DNS 방화벽 규칙 그룹을 연결 해제합니다.

aws route53profiles disassociate-resource-from-profile \ --profile-id rp-4987774726example \ --resource-arn arn:aws:route53resolver:us-east-1:123456789012:firewall-rule-group/rslvr-frg-cfe7f72example

출력:

{ "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" } }

다음 코드 예시에서는 get-profile-association의 사용 방법을 보여줍니다.

AWS CLI

프로파일 연결 정보 가져오기

다음 get-profile-association은 지정된 프로파일 연결의 정보를 반환합니다.

aws route53profiles get-profile-association \ --profile-association-id rpassoc-489ce212fexample

출력:

{ "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" } }

다음 코드 예시에서는 get-profile-resource-association의 사용 방법을 보여줍니다.

AWS CLI

프로파일에 연결된 리소스 정보 가져오기

다음 get-profile-resource-association은 프로파일에 대한 지정된 리소스 연결의 정보를 반환합니다.

aws route53profiles get-profile-resource-association \ --profile-resource-association-id rpr-001913120a7example

출력:

{ "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" } }

다음 코드 예시에서는 get-profile의 사용 방법을 보여줍니다.

AWS CLI

프로파일 정보 가져오기

다음 get-profile은 지정된 프로파일의 정보를 반환합니다.

aws route53profiles get-profile \ --profile-id rp-4987774726example

출력:

{ "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" } }
  • API 세부 정보는 AWS CLI 명령 참조GetProfile을 참조하세요.

다음 코드 예시에서는 list-profile-associations의 사용 방법을 보여줍니다.

AWS CLI

프로파일 연결 나열

다음은 AWS 계정의 프로파일 연결을 list-profile-associations 나열합니다.

aws route53profiles list-profile-associations

출력:

{ "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" } ] }

다음 코드 예시에서는 list-profile-resource-associations의 사용 방법을 보여줍니다.

AWS CLI

프로파일 리소스 연결 나열

다음 list-profile-resource-associations는 지정된 프로파일에 대한 프로파일 리소스 연결을 나열합니다.

aws route53profiles list-profile-resource-associations \ --profile-id rp-4987774726example

출력:

{ "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" } ] }

다음 코드 예시에서는 list-profiles의 사용 방법을 보여줍니다.

AWS CLI

프로파일 나열

다음은 AWS 계정의 프로필을 list-profiles 나열하고 이에 대한 추가 정보를 표시합니다.

aws route53profiles list-profiles

출력:

{ "ProfileSummaries": [ { "Arn": "arn:aws:route53profiles:us-east-1:123456789012:profile/rp-4987774726example", "Id": "rp-4987774726example", "Name": "test", "ShareStatus": "NOT_SHARED" } ] }
  • API 세부 정보는 AWS CLI 명령 참조ListProfiles를 참조하세요.

다음 코드 예시에서는 list-tags-for-resource의 사용 방법을 보여줍니다.

AWS CLI

리소스의 태그 나열

다음 list-tags-for-resource는 지정된 리소스의 태그를 나열합니다.

aws route53profiles list-tags-for-resource \ --resource-arn arn:aws:route53profiles:us-east-1:123456789012:profile/rp-4987774726example

출력:

{ "Tags": { "my-key-2": "my-value-2", "my-key-1": "my-value-1" } }

다음 코드 예시에서는 update-profile-resource-association의 사용 방법을 보여줍니다.

AWS CLI

프로파일에 연결된 리소스 업데이트

다음 update-profile-resource-association은 프로파일에 연결된 DNS 방화벽 규칙 그룹의 우선 순위를 업데이트합니다.

aws route53profiles update-profile-resource-association \ --profile-resource-association-id rpr-001913120a7example \ --resource-properties "{\"priority\": 105}"

출력:

{ "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" } }