Home directory - Restricted in aws transfer family using cloud formation template

0

Hi,

For adding a user with a home directory mapping, I tried the below stack template.

However, the home directory was not created after stack was run. It was in restricted mode.

If we only do to edit user configuration manually we can uncheck restricted.

I want to implement this mode in yaml template.

Please help me to do better.

GoldcoastTvodUser:
    Type: 'AWS::Transfer::User'
    Properties:
      HomeDirectoryMappings:
        - Entry: /
          Target: /goldcoast-tvod
      HomeDirectoryType: LOGICAL
      Policy:
        'Fn::Sub': |
          {
            "Version": "2012-10-17",
            "Statement": {
              "Sid": "AllowFullAccessToBucket",
              "Action": "s3:*",
              "Effect": "Allow", 
              "Resource": [
                "arn:aws:s3:::goldcoast-tvod",
                "arn:aws:s3:::goldcoast-tvod/*"
              ]
            }
          }
      Role:
        'Fn::Sub': 'arn:aws:iam::${AWS::AccountId}:role/TransferManagementRole'
      ServerId:
        'Fn::GetAtt': TransferServer.ServerId
      SshPublicKeys:
        - >-
          ssh-rsa
          AAAAB
      UserName: GoldcoastTvodUser

1 Answer
1
Accepted Answer

If you change the HomeDirectoryType to PATH, it'll remove the restricted.

      HomeDirectory: "/goldcoast-tvod"
      HomeDirectoryType: "PATH"

P.S. although it's only a public SSH key, you might want to remove it from your question.

AWS
EXPERT
Raphael
answered a year ago
  • Hi,

    Thanks much i have removed my public key and let me try your update and let you the working status.

    Thanks,

  • Hi,

    Thank you for the answer and YES! that was the fix.

    GoldcoastTvodUser: Type: 'AWS::Transfer::User' Properties: HomeDirectory: "/goldcoast-tvod" HomeDirectoryType: "PATH"

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions