本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/efs.EFS.CreateMountTarget方法的典型用法代码示例。如果您正苦于以下问题:Golang EFS.CreateMountTarget方法的具体用法?Golang EFS.CreateMountTarget怎么用?Golang EFS.CreateMountTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/aws/aws-sdk-go/service/efs.EFS
的用法示例。
在下文中一共展示了EFS.CreateMountTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: CreateMountTarget
// Helper function to create an EFS Mount target.
func CreateMountTarget(e *efs.EFS, i string, s string) (*efs.MountTargetDescription, error) {
var security []*string
// Determine if we need to assign a security group to this mount point, otherwise defer
// to the default group.
if *cliSecurity != "" {
security = []*string{
cliSecurity,
}
}
params := &efs.CreateMountTargetInput{
FileSystemId: aws.String(i),
SubnetId: aws.String(s),
SecurityGroups: security,
}
resp, err := e.CreateMountTarget(params)
if err != nil {
return nil, err
}
// Wait for the mount point to become available.
for {
mnt, err := DescribeMountTarget(e, i)
if err != nil {
return nil, err
}
if len(mnt.MountTargets) > 0 {
if *mnt.MountTargets[0].LifeCycleState == efsAvail {
break
}
}
time.Sleep(10 * time.Second)
}
return resp, nil
}