本文整理匯總了Golang中github.com/aws/aws-sdk-go/service/autoscaling.PutLifecycleHookInput.RoleARN方法的典型用法代碼示例。如果您正苦於以下問題:Golang PutLifecycleHookInput.RoleARN方法的具體用法?Golang PutLifecycleHookInput.RoleARN怎麽用?Golang PutLifecycleHookInput.RoleARN使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/aws/aws-sdk-go/service/autoscaling.PutLifecycleHookInput
的用法示例。
在下文中一共展示了PutLifecycleHookInput.RoleARN方法的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
}
示例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
}