Skip to content

efs.AccessPoint: Not possible to tag construct using Tags.of(...) #20743

Closed
@fredbonin

Description

@fredbonin

Describe the bug

If you try to tag an efs.AccessPoint construct using Tags.of(...) , the tag won't be applied.

Expected Behavior

I would expect the tag to be applied

Current Behavior

Tag specified using Tags.of is never assigned and no error messages are seen in the console

Reproduction Steps

Here is a sample code that reproduces the issue :

        let accessPoint = new efs.AccessPoint(this, "EfsAP", {
                fileSystem: fileSystem,
                createAcl : {
                    ownerUid : "1000",
                    ownerGid : "1000",
                    permissions : "755"
                },
                path: "/myPath",
                posixUser: {
                    gid: "1000",
                    uid: "1000",
                    secondaryGids : []
                }
            }
        );
        Tags.of(accessPoint).add('Name', 'my-tag'); // BUG : Tag won't be applied

Possible Solution

A workaround is to use this CfnConstruct (this is a possible workaround, but it would be better to use L2 construct) :

      new CfnAccessPoint(this, 'Resource', {
            accessPointTags: [{
              key : "Name",
              value : "my-tag"
            }],
            fileSystemId: fileSystem.fileSystemId,
            rootDirectory: {
                creationInfo: {
                    ownerGid: "1000",
                    ownerUid: "1000",
                    permissions: "755",
                },
                path: "/myPath",
            },
            posixUser: {
                uid: "1000",
                gid: "1000",
                secondaryGids: [],
            },
        });

Additional Information/Context

No response

CDK CLI Version

2.27.0 (build 8e89048)

Framework Version

No response

Node.js Version

v16.14.0

OS

MacOS 12.4

Language

Typescript

Language Version

~3.9.7

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-efsRelated to Amazon Elastic File SystembugThis issue is a bug.effort/smallSmall work item – less than a day of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions