本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/directoryservice.DirectoryService.ConnectDirectory方法的典型用法代码示例。如果您正苦于以下问题:Golang DirectoryService.ConnectDirectory方法的具体用法?Golang DirectoryService.ConnectDirectory怎么用?Golang DirectoryService.ConnectDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/aws/aws-sdk-go/service/directoryservice.DirectoryService
的用法示例。
在下文中一共展示了DirectoryService.ConnectDirectory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: createDirectoryConnector
func createDirectoryConnector(dsconn *directoryservice.DirectoryService, d *schema.ResourceData) (directoryId string, err error) {
if _, ok := d.GetOk("size"); !ok {
return "", fmt.Errorf("size is required for type = ADConnector")
}
input := directoryservice.ConnectDirectoryInput{
Name: aws.String(d.Get("name").(string)),
Password: aws.String(d.Get("password").(string)),
Size: aws.String(d.Get("size").(string)),
}
if v, ok := d.GetOk("description"); ok {
input.Description = aws.String(v.(string))
}
if v, ok := d.GetOk("short_name"); ok {
input.ShortName = aws.String(v.(string))
}
input.ConnectSettings, err = buildConnectSettings(d)
if err != nil {
return "", err
}
log.Printf("[DEBUG] Creating Directory Connector: %s", input)
out, err := dsconn.ConnectDirectory(&input)
if err != nil {
return "", err
}
log.Printf("[DEBUG] Directory Connector created: %s", out)
return *out.DirectoryId, nil
}