本文整理匯總了Golang中github.com/aws/aws-sdk-go/service/elasticbeanstalk.ElasticBeanstalk.ValidateConfigurationSettings方法的典型用法代碼示例。如果您正苦於以下問題:Golang ElasticBeanstalk.ValidateConfigurationSettings方法的具體用法?Golang ElasticBeanstalk.ValidateConfigurationSettings怎麽用?Golang ElasticBeanstalk.ValidateConfigurationSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/aws/aws-sdk-go/service/elasticbeanstalk.ElasticBeanstalk
的用法示例。
在下文中一共展示了ElasticBeanstalk.ValidateConfigurationSettings方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: resourceAwsElasticBeanstalkConfigurationTemplateOptionSettingsUpdate
func resourceAwsElasticBeanstalkConfigurationTemplateOptionSettingsUpdate(conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error {
if d.HasChange("setting") {
_, err := conn.ValidateConfigurationSettings(&elasticbeanstalk.ValidateConfigurationSettingsInput{
ApplicationName: aws.String(d.Get("application").(string)),
TemplateName: aws.String(d.Get("name").(string)),
OptionSettings: gatherOptionSettings(d),
})
if err != nil {
return err
}
o, n := d.GetChange("setting")
if o == nil {
o = new(schema.Set)
}
if n == nil {
n = new(schema.Set)
}
os := o.(*schema.Set)
ns := o.(*schema.Set)
remove := extractOptionSettings(os.Difference(ns))
add := extractOptionSettings(ns.Difference(os))
req := &elasticbeanstalk.UpdateConfigurationTemplateInput{
ApplicationName: aws.String(d.Get("application").(string)),
TemplateName: aws.String(d.Get("name").(string)),
OptionSettings: add,
}
for _, elem := range remove {
req.OptionsToRemove = append(req.OptionsToRemove, &elasticbeanstalk.OptionSpecification{
Namespace: elem.Namespace,
OptionName: elem.OptionName,
})
}
if _, err := conn.UpdateConfigurationTemplate(req); err != nil {
return err
}
}
return nil
}
開發者ID:monkeylittleinc,項目名稱:terraform,代碼行數:45,代碼來源:resource_aws_elastic_beanstalk_configuration_template.go
示例2: resourceAwsElasticBeanstalkConfigurationTemplateOptionSettingsUpdate
func resourceAwsElasticBeanstalkConfigurationTemplateOptionSettingsUpdate(conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error {
if d.HasChange("setting") {
_, err := conn.ValidateConfigurationSettings(&elasticbeanstalk.ValidateConfigurationSettingsInput{
ApplicationName: aws.String(d.Get("application").(string)),
TemplateName: aws.String(d.Get("name").(string)),
OptionSettings: gatherOptionSettings(d),
})
if err != nil {
return err
}
o, n := d.GetChange("setting")
if o == nil {
o = new(schema.Set)
}
if n == nil {
n = new(schema.Set)
}
os := o.(*schema.Set)
ns := n.(*schema.Set)
rm := extractOptionSettings(os.Difference(ns))
add := extractOptionSettings(ns.Difference(os))
// Additions and removals of options are done in a single API call, so we
// can't do our normal "remove these" and then later "add these", re-adding
// any updated settings.
// Because of this, we need to remove any settings in the "removable"
// settings that are also found in the "add" settings, otherwise they
// conflict. Here we loop through all the initial removables from the set
// difference, and we build up a slice of settings not found in the "add"
// set
var remove []*elasticbeanstalk.ConfigurationOptionSetting
for _, r := range rm {
for _, a := range add {
if *r.Namespace == *a.Namespace && *r.OptionName == *a.OptionName {
continue
}
remove = append(remove, r)
}
}
req := &elasticbeanstalk.UpdateConfigurationTemplateInput{
ApplicationName: aws.String(d.Get("application").(string)),
TemplateName: aws.String(d.Get("name").(string)),
OptionSettings: add,
}
for _, elem := range remove {
req.OptionsToRemove = append(req.OptionsToRemove, &elasticbeanstalk.OptionSpecification{
Namespace: elem.Namespace,
OptionName: elem.OptionName,
})
}
log.Printf("[DEBUG] Update Configuration Template request: %s", req)
if _, err := conn.UpdateConfigurationTemplate(req); err != nil {
return err
}
}
return nil
}
開發者ID:RezaDKhan,項目名稱:terraform,代碼行數:64,代碼來源:resource_aws_elastic_beanstalk_configuration_template.go