Tagging option not available in Managed Directory

0

Hi, I want to attach a tag to my aws managed directory, but as i explore the console for aws managed directory service i cant see any option to attach tags to my directory. can anyone please help to understand how can i attach the tags to my already created/existing directory

3개 답변
2

Hi,

  1. Install and Configure AWS CLI: Make sure you have the AWS Command Line Interface (CLI) installed and configured on your local machine.

  2. Tag the Directory: Use the add-tags-to-resource command to tag your AWS Managed Microsoft AD directory. Replace directory-id with the actual ID of your directory and specify the tags you want to attach.

aws ds add-tags-to-resource --resource-id directory-id --tags Key1=Value1 Key2=Value2

Replace Key1=Value1, Key2=Value2, etc., with the tags you want to attach. You can specify multiple tags separated by spaces.

For example: aws ds add-tags-to-resource --resource-id d-xxxxxxxxxx --tags Environment=Production Owner=JohnDoe

This command will tag the specified directory with two tags: Environment=Production and Owner=JohnDoe.

Please note that only certain resources support tagging, and AWS Managed Microsoft AD is one of them. However, not all AWS services provide tagging functionality through the AWS Management Console. In such cases, you can use the AWS CLI or SDKs to manage tags programmatically.

답변함 일 년 전
  • AWS CLI tags are formated "Key=string,Value=string", ie. above would be "--tags Key=Environment,Value=Production"

2

Replace directory-id with the actual ID of your directory and specify the tags you want to add.

Example that worked adding tag;

$ aws ds add-tags-to-resource --resource-id d-9xxxxxxxxx --tags  Key=Environment,Value=Production  Key=Owner,Value=JohnDoe

Confirm tags are added

$ aws ds list-tags-for-resource --resource-id d-9xxxxxxx 
{
    "Tags": [
        {
            "Key": "Environment",
            "Value": "Production"
        },
        {
            "Key": "Owner",
            "Value": "JohnDoe"
        }
    ]
}
답변함 일 년 전
0

It's sometimes easier to use AWS CloudShell vs installing the CLI on a local computer

Run 'pwsh' to use PowerShell

You can use the Add-DSResourceTag command to add multiple tags

Add-DSResourceTag `
    -ResourceId d-123456789a `
    -Tag @(
        @{Key="Environment";Value="Production"},
        @{key="Department";value="Operations"}
    )

and the Get-DSResourceTag to query tags

Get-DSResourceTag -ResourceId d-123456789a                                                                                    '
Key         Value
---         -----
Environment Production
Department  Operations
AWS
답변함 7달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인