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 回答
1
已接受的回答

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
专家
Raphael
已回答 1 年前
  • 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"

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则