CloudFormation - Partitioning EBS root volume

一个人想着一个人 提交于 2020-01-06 08:06:14

问题


Below is the cloudformation template to create EC2 instance:

    "EC2Instance":{
        "Type": "AWS::EC2::Instance",
        "Properties":{
            "ImageId": "ami-099999999999a27",
            "InstanceType": "t2.micro",
            "SubnetId": { "Ref": "SubnetId"},
            "KeyName": { "Ref": "KeyName"},
            "SecurityGroupIds": [ { "Ref": "EC2InstanceSecurityGroup"} ],
            "IamInstanceProfile": { "Ref" : "EC2InstanceProfile"},
            "UserData":{
                "Fn::Base64": { "Fn::Join": ["", [
                    "#!/bin/bash\n",
                    "echo ECS_CLUSTER=", { "Ref": "EcsCluster" }, " >> /etc/ecs/ecs.config\n",
                    "groupadd -g 1000 jenkins\n",
                    "useradd -u 1000 -g jenkins jenkins\n",
                    "mkdir -p /a/b\n",
                    "chown -R jenkins:jenkins /a/b\n"
                ] ] }
            },
            "Tags": [ { "Key": "Name", "Value": { "Fn::Join": ["", [ { "Ref": "AWS::StackName"}, "-instance" ] ]} }]
        }
    },

We would like to have /a/b mounted to dedicated partition with specific size.

Can we partition EBS volume that is used by EC2 instance? using CloudFormation

Do we need packer for this configuration? using amazon-ebs builder

来源:https://stackoverflow.com/questions/59586518/cloudformation-partitioning-ebs-root-volume

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!