问题
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