本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/autoscaling.PutLifecycleHookInput类的典型用法代码示例。如果您正苦于以下问题:Golang PutLifecycleHookInput类的具体用法?Golang PutLifecycleHookInput怎么用?Golang PutLifecycleHookInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PutLifecycleHookInput类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: getAwsAutoscalingPutLifecycleHookInput
func getAwsAutoscalingPutLifecycleHookInput(d *schema.ResourceData) autoscaling.PutLifecycleHookInput {
var params = autoscaling.PutLifecycleHookInput{
AutoScalingGroupName: aws.String(d.Get("autoscaling_group_name").(string)),
LifecycleHookName: aws.String(d.Get("name").(string)),
}
if v, ok := d.GetOk("default_result"); ok {
params.DefaultResult = aws.String(v.(string))
}
if v, ok := d.GetOk("heartbeat_timeout"); ok {
params.HeartbeatTimeout = aws.Int64(int64(v.(int)))
}
if v, ok := d.GetOk("lifecycle_transition"); ok {
params.LifecycleTransition = aws.String(v.(string))
}
if v, ok := d.GetOk("notification_metadata"); ok {
params.NotificationMetadata = aws.String(v.(string))
}
if v, ok := d.GetOk("notification_target_arn"); ok {
params.NotificationTargetARN = aws.String(v.(string))
}
if v, ok := d.GetOk("role_arn"); ok {
params.RoleARN = aws.String(v.(string))
}
return params
}
开发者ID:ephemeralsnow,项目名称:terraform,代码行数:32,代码来源:resource_aws_autoscaling_lifecycle_hook.go
示例2: generatePutLifecycleHookInputs
func generatePutLifecycleHookInputs(asgName string, cfgs []interface{}) []autoscaling.PutLifecycleHookInput {
res := make([]autoscaling.PutLifecycleHookInput, 0, len(cfgs))
for _, raw := range cfgs {
cfg := raw.(map[string]interface{})
input := autoscaling.PutLifecycleHookInput{
AutoScalingGroupName: &asgName,
LifecycleHookName: aws.String(cfg["name"].(string)),
}
if v, ok := cfg["default_result"]; ok && v.(string) != "" {
input.DefaultResult = aws.String(v.(string))
}
if v, ok := cfg["heartbeat_timeout"]; ok && v.(int) > 0 {
input.HeartbeatTimeout = aws.Int64(int64(v.(int)))
}
if v, ok := cfg["lifecycle_transition"]; ok && v.(string) != "" {
input.LifecycleTransition = aws.String(v.(string))
}
if v, ok := cfg["notification_metadata"]; ok && v.(string) != "" {
input.NotificationMetadata = aws.String(v.(string))
}
if v, ok := cfg["notification_target_arn"]; ok && v.(string) != "" {
input.NotificationTargetARN = aws.String(v.(string))
}
if v, ok := cfg["role_arn"]; ok && v.(string) != "" {
input.RoleARN = aws.String(v.(string))
}
res = append(res, input)
}
return res
}
开发者ID:paultyng,项目名称:terraform,代码行数:40,代码来源:resource_aws_autoscaling_group.go
注:本文中的github.com/aws/aws-sdk-go/service/autoscaling.PutLifecycleHookInput类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论