Merge branch 'master' into brandontosch/GH-11874
# Conflicts: # vendor/vendor.json
This commit is contained in:
commit
193c25788d
|
@ -6,45 +6,49 @@ import (
|
|||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/service/autoscaling"
|
||||
"github.com/hashicorp/terraform/helper/acctest"
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
)
|
||||
|
||||
func TestAccAwsAutoscalingAttachment_basic(t *testing.T) {
|
||||
|
||||
rInt := acctest.RandInt()
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccAWSAutoscalingAttachment_basic,
|
||||
Config: testAccAWSAutoscalingAttachment_basic(rInt),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckAWSAutocalingAttachmentExists("aws_autoscaling_group.asg", 0),
|
||||
),
|
||||
},
|
||||
// Add in one association
|
||||
resource.TestStep{
|
||||
Config: testAccAWSAutoscalingAttachment_associated,
|
||||
Config: testAccAWSAutoscalingAttachment_associated(rInt),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckAWSAutocalingAttachmentExists("aws_autoscaling_group.asg", 1),
|
||||
),
|
||||
},
|
||||
// Test adding a 2nd
|
||||
resource.TestStep{
|
||||
Config: testAccAWSAutoscalingAttachment_double_associated,
|
||||
Config: testAccAWSAutoscalingAttachment_double_associated(rInt),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckAWSAutocalingAttachmentExists("aws_autoscaling_group.asg", 2),
|
||||
),
|
||||
},
|
||||
// Now remove that newest one
|
||||
resource.TestStep{
|
||||
Config: testAccAWSAutoscalingAttachment_associated,
|
||||
Config: testAccAWSAutoscalingAttachment_associated(rInt),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckAWSAutocalingAttachmentExists("aws_autoscaling_group.asg", 1),
|
||||
),
|
||||
},
|
||||
// Now remove them both
|
||||
resource.TestStep{
|
||||
Config: testAccAWSAutoscalingAttachment_basic,
|
||||
Config: testAccAWSAutoscalingAttachment_basic(rInt),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckAWSAutocalingAttachmentExists("aws_autoscaling_group.asg", 0),
|
||||
),
|
||||
|
@ -79,7 +83,8 @@ func testAccCheckAWSAutocalingAttachmentExists(asgname string, loadBalancerCount
|
|||
}
|
||||
}
|
||||
|
||||
const testAccAWSAutoscalingAttachment_basic = `
|
||||
func testAccAWSAutoscalingAttachment_basic(rInt int) string {
|
||||
return fmt.Sprintf(`
|
||||
resource "aws_elb" "foo" {
|
||||
availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"]
|
||||
|
||||
|
@ -103,14 +108,14 @@ resource "aws_elb" "bar" {
|
|||
}
|
||||
|
||||
resource "aws_launch_configuration" "as_conf" {
|
||||
name = "test_config"
|
||||
name = "test_config_%d"
|
||||
image_id = "ami-f34032c3"
|
||||
instance_type = "t1.micro"
|
||||
}
|
||||
|
||||
resource "aws_autoscaling_group" "asg" {
|
||||
availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"]
|
||||
name = "asg-lb-assoc-terraform-test"
|
||||
name = "asg-lb-assoc-terraform-test_%d"
|
||||
max_size = 1
|
||||
min_size = 0
|
||||
desired_capacity = 0
|
||||
|
@ -123,22 +128,21 @@ resource "aws_autoscaling_group" "asg" {
|
|||
value = "terraform-asg-lg-assoc-test"
|
||||
propagate_at_launch = true
|
||||
}
|
||||
}`, rInt, rInt)
|
||||
}
|
||||
|
||||
`
|
||||
|
||||
const testAccAWSAutoscalingAttachment_associated = testAccAWSAutoscalingAttachment_basic + `
|
||||
func testAccAWSAutoscalingAttachment_associated(rInt int) string {
|
||||
return testAccAWSAutoscalingAttachment_basic(rInt) + `
|
||||
resource "aws_autoscaling_attachment" "asg_attachment_foo" {
|
||||
autoscaling_group_name = "${aws_autoscaling_group.asg.id}"
|
||||
elb = "${aws_elb.foo.id}"
|
||||
}`
|
||||
}
|
||||
|
||||
`
|
||||
|
||||
const testAccAWSAutoscalingAttachment_double_associated = testAccAWSAutoscalingAttachment_associated + `
|
||||
func testAccAWSAutoscalingAttachment_double_associated(rInt int) string {
|
||||
return testAccAWSAutoscalingAttachment_associated(rInt) + `
|
||||
resource "aws_autoscaling_attachment" "asg_attachment_bar" {
|
||||
autoscaling_group_name = "${aws_autoscaling_group.asg.id}"
|
||||
elb = "${aws_elb.bar.id}"
|
||||
}`
|
||||
}
|
||||
|
||||
`
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/hashicorp/terraform/helper/hashcode"
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
|
@ -255,7 +256,7 @@ func resourceAwsElasticBeanstalkEnvironmentCreate(d *schema.ResourceData, meta i
|
|||
createOpts.VersionLabel = aws.String(version)
|
||||
}
|
||||
|
||||
// Get the current time to filter describeBeanstalkEvents messages
|
||||
// Get the current time to filter getBeanstalkEnvironmentErrors messages
|
||||
t := time.Now()
|
||||
log.Printf("[DEBUG] Elastic Beanstalk Environment create opts: %s", createOpts)
|
||||
resp, err := conn.CreateEnvironment(&createOpts)
|
||||
|
@ -280,7 +281,7 @@ func resourceAwsElasticBeanstalkEnvironmentCreate(d *schema.ResourceData, meta i
|
|||
stateConf := &resource.StateChangeConf{
|
||||
Pending: []string{"Launching", "Updating"},
|
||||
Target: []string{"Ready"},
|
||||
Refresh: environmentStateRefreshFunc(conn, d.Id()),
|
||||
Refresh: environmentStateRefreshFunc(conn, d.Id(), t),
|
||||
Timeout: waitForReadyTimeOut,
|
||||
Delay: 10 * time.Second,
|
||||
PollInterval: pollInterval,
|
||||
|
@ -294,10 +295,13 @@ func resourceAwsElasticBeanstalkEnvironmentCreate(d *schema.ResourceData, meta i
|
|||
d.Id(), err)
|
||||
}
|
||||
|
||||
err = describeBeanstalkEvents(conn, d.Id(), t)
|
||||
envErrors, err := getBeanstalkEnvironmentErrors(conn, d.Id(), t)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if envErrors != nil {
|
||||
return envErrors
|
||||
}
|
||||
|
||||
return resourceAwsElasticBeanstalkEnvironmentRead(d, meta)
|
||||
}
|
||||
|
@ -403,7 +407,7 @@ func resourceAwsElasticBeanstalkEnvironmentUpdate(d *schema.ResourceData, meta i
|
|||
}
|
||||
|
||||
if hasChange {
|
||||
// Get the current time to filter describeBeanstalkEvents messages
|
||||
// Get the current time to filter getBeanstalkEnvironmentErrors messages
|
||||
t := time.Now()
|
||||
log.Printf("[DEBUG] Elastic Beanstalk Environment update opts: %s", updateOpts)
|
||||
_, err := conn.UpdateEnvironment(&updateOpts)
|
||||
|
@ -424,7 +428,7 @@ func resourceAwsElasticBeanstalkEnvironmentUpdate(d *schema.ResourceData, meta i
|
|||
stateConf := &resource.StateChangeConf{
|
||||
Pending: []string{"Launching", "Updating"},
|
||||
Target: []string{"Ready"},
|
||||
Refresh: environmentStateRefreshFunc(conn, d.Id()),
|
||||
Refresh: environmentStateRefreshFunc(conn, d.Id(), t),
|
||||
Timeout: waitForReadyTimeOut,
|
||||
Delay: 10 * time.Second,
|
||||
PollInterval: pollInterval,
|
||||
|
@ -438,10 +442,13 @@ func resourceAwsElasticBeanstalkEnvironmentUpdate(d *schema.ResourceData, meta i
|
|||
d.Id(), err)
|
||||
}
|
||||
|
||||
err = describeBeanstalkEvents(conn, d.Id(), t)
|
||||
envErrors, err := getBeanstalkEnvironmentErrors(conn, d.Id(), t)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if envErrors != nil {
|
||||
return envErrors
|
||||
}
|
||||
}
|
||||
|
||||
return resourceAwsElasticBeanstalkEnvironmentRead(d, meta)
|
||||
|
@ -663,7 +670,7 @@ func resourceAwsElasticBeanstalkEnvironmentDelete(d *schema.ResourceData, meta i
|
|||
TerminateResources: aws.Bool(true),
|
||||
}
|
||||
|
||||
// Get the current time to filter describeBeanstalkEvents messages
|
||||
// Get the current time to filter getBeanstalkEnvironmentErrors messages
|
||||
t := time.Now()
|
||||
log.Printf("[DEBUG] Elastic Beanstalk Environment terminate opts: %s", opts)
|
||||
_, err := conn.TerminateEnvironment(&opts)
|
||||
|
@ -685,7 +692,7 @@ func resourceAwsElasticBeanstalkEnvironmentDelete(d *schema.ResourceData, meta i
|
|||
stateConf := &resource.StateChangeConf{
|
||||
Pending: []string{"Terminating"},
|
||||
Target: []string{"Terminated"},
|
||||
Refresh: environmentStateRefreshFunc(conn, d.Id()),
|
||||
Refresh: environmentStateRefreshFunc(conn, d.Id(), t),
|
||||
Timeout: waitForReadyTimeOut,
|
||||
Delay: 10 * time.Second,
|
||||
PollInterval: pollInterval,
|
||||
|
@ -699,17 +706,20 @@ func resourceAwsElasticBeanstalkEnvironmentDelete(d *schema.ResourceData, meta i
|
|||
d.Id(), err)
|
||||
}
|
||||
|
||||
err = describeBeanstalkEvents(conn, d.Id(), t)
|
||||
envErrors, err := getBeanstalkEnvironmentErrors(conn, d.Id(), t)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if envErrors != nil {
|
||||
return envErrors
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// environmentStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch
|
||||
// the creation of the Beanstalk Environment
|
||||
func environmentStateRefreshFunc(conn *elasticbeanstalk.ElasticBeanstalk, environmentId string) resource.StateRefreshFunc {
|
||||
func environmentStateRefreshFunc(conn *elasticbeanstalk.ElasticBeanstalk, environmentId string, t time.Time) resource.StateRefreshFunc {
|
||||
return func() (interface{}, string, error) {
|
||||
resp, err := conn.DescribeEnvironments(&elasticbeanstalk.DescribeEnvironmentsInput{
|
||||
EnvironmentIds: []*string{aws.String(environmentId)},
|
||||
|
@ -736,6 +746,14 @@ func environmentStateRefreshFunc(conn *elasticbeanstalk.ElasticBeanstalk, enviro
|
|||
return -1, "failed", fmt.Errorf("[Err] Error finding Elastic Beanstalk Environment, environment not found")
|
||||
}
|
||||
|
||||
envErrors, err := getBeanstalkEnvironmentErrors(conn, environmentId, t)
|
||||
if err != nil {
|
||||
return -1, "failed", err
|
||||
}
|
||||
if envErrors != nil {
|
||||
return -1, "failed", envErrors
|
||||
}
|
||||
|
||||
return env, *env.Status, nil
|
||||
}
|
||||
}
|
||||
|
@ -848,25 +866,48 @@ func dropGeneratedSecurityGroup(settingValue string, meta interface{}) string {
|
|||
return strings.Join(legitGroups, ",")
|
||||
}
|
||||
|
||||
func describeBeanstalkEvents(conn *elasticbeanstalk.ElasticBeanstalk, environmentId string, t time.Time) error {
|
||||
beanstalkErrors, err := conn.DescribeEvents(&elasticbeanstalk.DescribeEventsInput{
|
||||
type beanstalkEnvironmentError struct {
|
||||
eventDate *time.Time
|
||||
environmentID string
|
||||
message *string
|
||||
}
|
||||
|
||||
func (e beanstalkEnvironmentError) Error() string {
|
||||
return e.eventDate.String() + " (" + e.environmentID + ") : " + *e.message
|
||||
}
|
||||
|
||||
type beanstalkEnvironmentErrors []*beanstalkEnvironmentError
|
||||
|
||||
func (e beanstalkEnvironmentErrors) Len() int { return len(e) }
|
||||
func (e beanstalkEnvironmentErrors) Swap(i, j int) { e[i], e[j] = e[j], e[i] }
|
||||
func (e beanstalkEnvironmentErrors) Less(i, j int) bool { return e[i].eventDate.Before(*e[j].eventDate) }
|
||||
|
||||
func getBeanstalkEnvironmentErrors(conn *elasticbeanstalk.ElasticBeanstalk, environmentId string, t time.Time) (*multierror.Error, error) {
|
||||
environmentErrors, err := conn.DescribeEvents(&elasticbeanstalk.DescribeEventsInput{
|
||||
EnvironmentId: aws.String(environmentId),
|
||||
Severity: aws.String("ERROR"),
|
||||
StartTime: aws.Time(t),
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
log.Printf("[Err] Unable to get Elastic Beanstalk Evironment events: %s", err)
|
||||
return nil, fmt.Errorf("[Err] Unable to get Elastic Beanstalk Evironment events: %s", err)
|
||||
}
|
||||
|
||||
events := ""
|
||||
for _, event := range beanstalkErrors.Events {
|
||||
events = events + "\n" + event.EventDate.String() + ": " + *event.Message
|
||||
var events beanstalkEnvironmentErrors
|
||||
for _, event := range environmentErrors.Events {
|
||||
e := &beanstalkEnvironmentError{
|
||||
eventDate: event.EventDate,
|
||||
environmentID: environmentId,
|
||||
message: event.Message,
|
||||
}
|
||||
events = append(events, e)
|
||||
}
|
||||
sort.Sort(beanstalkEnvironmentErrors(events))
|
||||
|
||||
var result *multierror.Error
|
||||
for _, event := range events {
|
||||
result = multierror.Append(result, event)
|
||||
}
|
||||
|
||||
if events != "" {
|
||||
return fmt.Errorf("%s", events)
|
||||
}
|
||||
|
||||
return nil
|
||||
return result, nil
|
||||
}
|
||||
|
|
|
@ -190,7 +190,7 @@ resource "aws_subnet" "test_subnet" {
|
|||
}
|
||||
|
||||
resource "aws_iam_role" "test_role" {
|
||||
name = "test_role"
|
||||
name = "tf_test_%s"
|
||||
assume_role_policy = <<EOF
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
|
@ -222,5 +222,5 @@ resource "aws_flow_log" "test_flow_log_subnet" {
|
|||
subnet_id = "${aws_subnet.test_subnet.id}"
|
||||
traffic_type = "ALL"
|
||||
}
|
||||
`, fln)
|
||||
`, fln, fln)
|
||||
}
|
||||
|
|
|
@ -528,6 +528,7 @@ func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error {
|
|||
d.Set("private_ip", instance.PrivateIpAddress)
|
||||
d.Set("iam_instance_profile", iamInstanceProfileArnToName(instance.IamInstanceProfile))
|
||||
|
||||
var ipv6Addresses []string
|
||||
if len(instance.NetworkInterfaces) > 0 {
|
||||
for _, ni := range instance.NetworkInterfaces {
|
||||
if *ni.Attachment.DeviceIndex == 0 {
|
||||
|
@ -536,17 +537,20 @@ func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error {
|
|||
d.Set("associate_public_ip_address", ni.Association != nil)
|
||||
d.Set("ipv6_address_count", len(ni.Ipv6Addresses))
|
||||
|
||||
var ipv6Addresses []string
|
||||
for _, address := range ni.Ipv6Addresses {
|
||||
ipv6Addresses = append(ipv6Addresses, *address.Ipv6Address)
|
||||
}
|
||||
d.Set("ipv6_addresses", ipv6Addresses)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
d.Set("subnet_id", instance.SubnetId)
|
||||
d.Set("network_interface_id", "")
|
||||
}
|
||||
|
||||
if err := d.Set("ipv6_addresses", ipv6Addresses); err != nil {
|
||||
log.Printf("[WARN] Error setting ipv6_addresses for AWS Instance (%d): %s", d.Id(), err)
|
||||
}
|
||||
|
||||
d.Set("ebs_optimized", instance.EbsOptimized)
|
||||
if instance.SubnetId != nil && *instance.SubnetId != "" {
|
||||
d.Set("source_dest_check", instance.SourceDestCheck)
|
||||
|
|
|
@ -4,7 +4,9 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
|
||||
"google.golang.org/api/googleapi"
|
||||
|
@ -122,12 +124,23 @@ func resourceStorageBucketCreate(d *schema.ResourceData, meta interface{}) error
|
|||
}
|
||||
}
|
||||
|
||||
call := config.clientStorage.Buckets.Insert(project, sb)
|
||||
if v, ok := d.GetOk("predefined_acl"); ok {
|
||||
call = call.PredefinedAcl(v.(string))
|
||||
}
|
||||
var res *storage.Bucket
|
||||
|
||||
res, err := call.Do()
|
||||
err = resource.Retry(1*time.Minute, func() *resource.RetryError {
|
||||
call := config.clientStorage.Buckets.Insert(project, sb)
|
||||
if v, ok := d.GetOk("predefined_acl"); ok {
|
||||
call = call.PredefinedAcl(v.(string))
|
||||
}
|
||||
|
||||
res, err = call.Do()
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if gerr, ok := err.(*googleapi.Error); ok && gerr.Code == 429 {
|
||||
return resource.RetryableError(gerr)
|
||||
}
|
||||
return resource.NonRetryableError(err)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
fmt.Printf("Error creating bucket %s: %v", bucket, err)
|
||||
|
@ -260,7 +273,16 @@ func resourceStorageBucketDelete(d *schema.ResourceData, meta interface{}) error
|
|||
}
|
||||
|
||||
// remove empty bucket
|
||||
err := config.clientStorage.Buckets.Delete(bucket).Do()
|
||||
err := resource.Retry(1*time.Minute, func() *resource.RetryError {
|
||||
err := config.clientStorage.Buckets.Delete(bucket).Do()
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if gerr, ok := err.(*googleapi.Error); ok && gerr.Code == 429 {
|
||||
return resource.RetryableError(gerr)
|
||||
}
|
||||
return resource.NonRetryableError(err)
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Printf("Error deleting bucket %s: %v\n\n", bucket, err)
|
||||
return err
|
||||
|
|
|
@ -68,7 +68,7 @@ func TestAccStorageStorageClass(t *testing.T) {
|
|||
CheckDestroy: testAccGoogleStorageDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
{
|
||||
Config: testGoogleStorageBucketsReaderStorageClass(bucketName, "MULTI_REGIONAL"),
|
||||
Config: testGoogleStorageBucketsReaderStorageClass(bucketName, "MULTI_REGIONAL", ""),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckCloudStorageBucketExists(
|
||||
"google_storage_bucket.bucket", bucketName),
|
||||
|
@ -77,7 +77,7 @@ func TestAccStorageStorageClass(t *testing.T) {
|
|||
),
|
||||
},
|
||||
{
|
||||
Config: testGoogleStorageBucketsReaderStorageClass(bucketName, "NEARLINE"),
|
||||
Config: testGoogleStorageBucketsReaderStorageClass(bucketName, "NEARLINE", ""),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckCloudStorageBucketExists(
|
||||
"google_storage_bucket.bucket", bucketName),
|
||||
|
@ -86,12 +86,14 @@ func TestAccStorageStorageClass(t *testing.T) {
|
|||
),
|
||||
},
|
||||
{
|
||||
Config: testGoogleStorageBucketsReaderStorageClass(bucketName, "REGIONAL"),
|
||||
Config: testGoogleStorageBucketsReaderStorageClass(bucketName, "REGIONAL", "us-central1"),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckCloudStorageBucketExists(
|
||||
"google_storage_bucket.bucket", bucketName),
|
||||
resource.TestCheckResourceAttr(
|
||||
"google_storage_bucket.bucket", "storage_class", "REGIONAL"),
|
||||
resource.TestCheckResourceAttr(
|
||||
"google_storage_bucket.bucket", "location", "us-central1"),
|
||||
),
|
||||
},
|
||||
},
|
||||
|
@ -266,11 +268,16 @@ resource "google_storage_bucket" "bucket" {
|
|||
`, bucketName)
|
||||
}
|
||||
|
||||
func testGoogleStorageBucketsReaderStorageClass(bucketName string, storageClass string) string {
|
||||
func testGoogleStorageBucketsReaderStorageClass(bucketName, storageClass, location string) string {
|
||||
var locationBlock string
|
||||
if location != "" {
|
||||
locationBlock = fmt.Sprintf(`
|
||||
location = "%s"`, location)
|
||||
}
|
||||
return fmt.Sprintf(`
|
||||
resource "google_storage_bucket" "bucket" {
|
||||
name = "%s"
|
||||
storage_class = "%s"
|
||||
storage_class = "%s"%s
|
||||
}
|
||||
`, bucketName, storageClass)
|
||||
`, bucketName, storageClass, locationBlock)
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ func sqladminOperationWait(config *Config, op *sqladmin.Operation, activity stri
|
|||
state.MinTimeout = 2 * time.Second
|
||||
opRaw, err := state.WaitForState()
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error waiting for %s: %s", activity, err)
|
||||
return fmt.Errorf("Error waiting for %s (op %s): %s", activity, op.Name, err)
|
||||
}
|
||||
|
||||
op = opRaw.(*sqladmin.Operation)
|
||||
|
|
|
@ -72,7 +72,7 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
|
|||
var endpoint = d.Get("endpoint").(string)
|
||||
|
||||
proto := "tcp"
|
||||
if endpoint[0] == '/' {
|
||||
if len(endpoint) > 0 && endpoint[0] == '/' {
|
||||
proto = "unix"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ns1
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net/http"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
|
@ -19,6 +20,18 @@ func Provider() terraform.ResourceProvider {
|
|||
DefaultFunc: schema.EnvDefaultFunc("NS1_APIKEY", nil),
|
||||
Description: descriptions["api_key"],
|
||||
},
|
||||
"endpoint": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
DefaultFunc: schema.EnvDefaultFunc("NS1_ENDPOINT", nil),
|
||||
Description: descriptions["endpoint"],
|
||||
},
|
||||
"ignore_ssl": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
DefaultFunc: schema.EnvDefaultFunc("NS1_IGNORE_SSL", nil),
|
||||
Description: descriptions["ignore_ssl"],
|
||||
},
|
||||
},
|
||||
ResourcesMap: map[string]*schema.Resource{
|
||||
"ns1_zone": zoneResource(),
|
||||
|
@ -26,6 +39,7 @@ func Provider() terraform.ResourceProvider {
|
|||
"ns1_datasource": dataSourceResource(),
|
||||
"ns1_datafeed": dataFeedResource(),
|
||||
"ns1_monitoringjob": monitoringJobResource(),
|
||||
"ns1_notifylist": notifyListResource(),
|
||||
"ns1_user": userResource(),
|
||||
"ns1_apikey": apikeyResource(),
|
||||
"ns1_team": teamResource(),
|
||||
|
@ -36,7 +50,19 @@ func Provider() terraform.ResourceProvider {
|
|||
|
||||
func ns1Configure(d *schema.ResourceData) (interface{}, error) {
|
||||
httpClient := &http.Client{}
|
||||
n := ns1.NewClient(httpClient, ns1.SetAPIKey(d.Get("apikey").(string)))
|
||||
decos := []func(*ns1.Client){}
|
||||
decos = append(decos, ns1.SetAPIKey(d.Get("apikey").(string)))
|
||||
if v, ok := d.GetOk("endpoint"); ok {
|
||||
decos = append(decos, ns1.SetEndpoint(v.(string)))
|
||||
}
|
||||
if _, ok := d.GetOk("ignore_ssl"); ok {
|
||||
tr := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
httpClient.Transport = tr
|
||||
}
|
||||
|
||||
n := ns1.NewClient(httpClient, decos...)
|
||||
n.RateLimitStrategySleep()
|
||||
return n, nil
|
||||
}
|
||||
|
|
|
@ -166,6 +166,7 @@ func monitoringJobToResourceData(d *schema.ResourceData, r *monitor.Job) error {
|
|||
m["key"] = r.Key
|
||||
rules[i] = m
|
||||
}
|
||||
d.Set("rules", rules)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -31,8 +31,11 @@ func TestAccMonitoringJob_basic(t *testing.T) {
|
|||
testAccCheckMonitoringJobRapidRecheck(&mj, false),
|
||||
testAccCheckMonitoringJobPolicy(&mj, "quorum"),
|
||||
testAccCheckMonitoringJobConfigSend(&mj, "HEAD / HTTP/1.0\r\n\r\n"),
|
||||
testAccCheckMonitoringJobConfigPort(&mj, 80),
|
||||
testAccCheckMonitoringJobConfigHost(&mj, "1.1.1.1"),
|
||||
testAccCheckMonitoringJobConfigPort(&mj, 443),
|
||||
testAccCheckMonitoringJobConfigHost(&mj, "1.2.3.4"),
|
||||
testAccCheckMonitoringJobRuleValue(&mj, "200 OK"),
|
||||
testAccCheckMonitoringJobRuleComparison(&mj, "contains"),
|
||||
testAccCheckMonitoringJobRuleKey(&mj, "output"),
|
||||
),
|
||||
},
|
||||
},
|
||||
|
@ -58,8 +61,11 @@ func TestAccMonitoringJob_updated(t *testing.T) {
|
|||
testAccCheckMonitoringJobRapidRecheck(&mj, false),
|
||||
testAccCheckMonitoringJobPolicy(&mj, "quorum"),
|
||||
testAccCheckMonitoringJobConfigSend(&mj, "HEAD / HTTP/1.0\r\n\r\n"),
|
||||
testAccCheckMonitoringJobConfigPort(&mj, 80),
|
||||
testAccCheckMonitoringJobConfigHost(&mj, "1.1.1.1"),
|
||||
testAccCheckMonitoringJobConfigPort(&mj, 443),
|
||||
testAccCheckMonitoringJobConfigHost(&mj, "1.2.3.4"),
|
||||
testAccCheckMonitoringJobRuleValue(&mj, "200 OK"),
|
||||
testAccCheckMonitoringJobRuleComparison(&mj, "contains"),
|
||||
testAccCheckMonitoringJobRuleKey(&mj, "output"),
|
||||
),
|
||||
},
|
||||
resource.TestStep{
|
||||
|
@ -76,6 +82,9 @@ func TestAccMonitoringJob_updated(t *testing.T) {
|
|||
testAccCheckMonitoringJobConfigSend(&mj, "HEAD / HTTP/1.0\r\n\r\n"),
|
||||
testAccCheckMonitoringJobConfigPort(&mj, 443),
|
||||
testAccCheckMonitoringJobConfigHost(&mj, "1.1.1.1"),
|
||||
testAccCheckMonitoringJobRuleValue(&mj, "200"),
|
||||
testAccCheckMonitoringJobRuleComparison(&mj, "<="),
|
||||
testAccCheckMonitoringJobRuleKey(&mj, "connect"),
|
||||
),
|
||||
},
|
||||
},
|
||||
|
@ -242,6 +251,33 @@ func testAccCheckMonitoringJobConfigHost(mj *monitor.Job, expected string) resou
|
|||
}
|
||||
}
|
||||
|
||||
func testAccCheckMonitoringJobRuleValue(mj *monitor.Job, expected string) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
if mj.Rules[0].Value.(string) != expected {
|
||||
return fmt.Errorf("Rules[0].Value: got: %#v want: %#v", mj.Rules[0].Value.(string), expected)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func testAccCheckMonitoringJobRuleComparison(mj *monitor.Job, expected string) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
if mj.Rules[0].Comparison != expected {
|
||||
return fmt.Errorf("Rules[0].Comparison: got: %#v want: %#v", mj.Rules[0].Comparison, expected)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func testAccCheckMonitoringJobRuleKey(mj *monitor.Job, expected string) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
if mj.Rules[0].Key != expected {
|
||||
return fmt.Errorf("Rules[0].Key: got: %#v want: %#v", mj.Rules[0].Key, expected)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
const testAccMonitoringJobBasic = `
|
||||
resource "ns1_monitoringjob" "it" {
|
||||
job_type = "tcp"
|
||||
|
@ -250,10 +286,16 @@ resource "ns1_monitoringjob" "it" {
|
|||
regions = ["lga"]
|
||||
frequency = 60
|
||||
|
||||
config {
|
||||
config = {
|
||||
ssl = "1",
|
||||
send = "HEAD / HTTP/1.0\r\n\r\n"
|
||||
port = 80
|
||||
host = "1.1.1.1"
|
||||
port = 443
|
||||
host = "1.2.3.4"
|
||||
}
|
||||
rules = {
|
||||
value = "200 OK"
|
||||
comparison = "contains"
|
||||
key = "output"
|
||||
}
|
||||
}
|
||||
`
|
||||
|
@ -269,10 +311,16 @@ resource "ns1_monitoringjob" "it" {
|
|||
rapid_recheck = true
|
||||
policy = "all"
|
||||
|
||||
config {
|
||||
config = {
|
||||
ssl = "1",
|
||||
send = "HEAD / HTTP/1.0\r\n\r\n"
|
||||
port = 443
|
||||
host = "1.1.1.1"
|
||||
}
|
||||
rules = {
|
||||
value = 200
|
||||
comparison = "<="
|
||||
key = "connect"
|
||||
}
|
||||
}
|
||||
`
|
||||
|
|
|
@ -0,0 +1,140 @@
|
|||
package ns1
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
|
||||
ns1 "gopkg.in/ns1/ns1-go.v2/rest"
|
||||
"gopkg.in/ns1/ns1-go.v2/rest/model/monitor"
|
||||
)
|
||||
|
||||
func notifyListResource() *schema.Resource {
|
||||
return &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"id": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"notifications": &schema.Schema{
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"type": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"config": &schema.Schema{
|
||||
Type: schema.TypeMap,
|
||||
Required: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Create: NotifyListCreate,
|
||||
Read: NotifyListRead,
|
||||
Update: NotifyListUpdate,
|
||||
Delete: NotifyListDelete,
|
||||
}
|
||||
}
|
||||
|
||||
func notifyListToResourceData(d *schema.ResourceData, nl *monitor.NotifyList) error {
|
||||
d.SetId(nl.ID)
|
||||
d.Set("name", nl.Name)
|
||||
|
||||
if len(nl.Notifications) > 0 {
|
||||
notifications := make([]map[string]interface{}, len(nl.Notifications))
|
||||
for i, n := range nl.Notifications {
|
||||
ni := make(map[string]interface{})
|
||||
ni["type"] = n.Type
|
||||
if n.Config != nil {
|
||||
ni["config"] = n.Config
|
||||
}
|
||||
notifications[i] = ni
|
||||
}
|
||||
d.Set("notifications", notifications)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func resourceDataToNotifyList(nl *monitor.NotifyList, d *schema.ResourceData) error {
|
||||
nl.ID = d.Id()
|
||||
|
||||
if rawNotifications := d.Get("notifications").([]interface{}); len(rawNotifications) > 0 {
|
||||
ns := make([]*monitor.Notification, len(rawNotifications))
|
||||
for i, notificationRaw := range rawNotifications {
|
||||
ni := notificationRaw.(map[string]interface{})
|
||||
config := ni["config"].(map[string]interface{})
|
||||
|
||||
switch ni["type"].(string) {
|
||||
case "webhook":
|
||||
ns[i] = monitor.NewWebNotification(config["url"].(string))
|
||||
case "email":
|
||||
ns[i] = monitor.NewEmailNotification(config["email"].(string))
|
||||
case "datafeed":
|
||||
ns[i] = monitor.NewFeedNotification(config["sourceid"].(string))
|
||||
}
|
||||
}
|
||||
nl.Notifications = ns
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotifyListCreate creates an ns1 notifylist
|
||||
func NotifyListCreate(d *schema.ResourceData, meta interface{}) error {
|
||||
client := meta.(*ns1.Client)
|
||||
nl := monitor.NewNotifyList(d.Get("name").(string))
|
||||
|
||||
if err := resourceDataToNotifyList(nl, d); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := client.Notifications.Create(nl); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return notifyListToResourceData(d, nl)
|
||||
}
|
||||
|
||||
// NotifyListRead fetches info for the given notifylist from ns1
|
||||
func NotifyListRead(d *schema.ResourceData, meta interface{}) error {
|
||||
client := meta.(*ns1.Client)
|
||||
|
||||
nl, _, err := client.Notifications.Get(d.Id())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return notifyListToResourceData(d, nl)
|
||||
}
|
||||
|
||||
// NotifyListDelete deletes the given notifylist from ns1
|
||||
func NotifyListDelete(d *schema.ResourceData, meta interface{}) error {
|
||||
client := meta.(*ns1.Client)
|
||||
|
||||
_, err := client.Notifications.Delete(d.Id())
|
||||
d.SetId("")
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// NotifyListUpdate updates the notifylist with given parameters
|
||||
func NotifyListUpdate(d *schema.ResourceData, meta interface{}) error {
|
||||
client := meta.(*ns1.Client)
|
||||
|
||||
nl := monitor.NewNotifyList(d.Get("name").(string))
|
||||
|
||||
if err := resourceDataToNotifyList(nl, d); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, err := client.Notifications.Update(nl); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return notifyListToResourceData(d, nl)
|
||||
}
|
|
@ -0,0 +1,158 @@
|
|||
package ns1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
|
||||
ns1 "gopkg.in/ns1/ns1-go.v2/rest"
|
||||
"gopkg.in/ns1/ns1-go.v2/rest/model/monitor"
|
||||
)
|
||||
|
||||
func TestAccNotifyList_basic(t *testing.T) {
|
||||
var nl monitor.NotifyList
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckNotifyListDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccNotifyListBasic,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckNotifyListExists("ns1_notifylist.test", &nl),
|
||||
testAccCheckNotifyListName(&nl, "terraform test"),
|
||||
),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func TestAccNotifyList_updated(t *testing.T) {
|
||||
var nl monitor.NotifyList
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckNotifyListDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccNotifyListBasic,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckNotifyListExists("ns1_notifylist.test", &nl),
|
||||
testAccCheckNotifyListName(&nl, "terraform test"),
|
||||
),
|
||||
},
|
||||
resource.TestStep{
|
||||
Config: testAccNotifyListUpdated,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckNotifyListExists("ns1_notifylist.test", &nl),
|
||||
testAccCheckNotifyListName(&nl, "terraform test"),
|
||||
),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func testAccCheckNotifyListState(key, value string) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
rs, ok := s.RootModule().Resources["ns1_notifylist.test"]
|
||||
if !ok {
|
||||
return fmt.Errorf("Not found: %s", "ns1_notifylist.test")
|
||||
}
|
||||
|
||||
if rs.Primary.ID == "" {
|
||||
return fmt.Errorf("No ID is set")
|
||||
}
|
||||
|
||||
p := rs.Primary
|
||||
if p.Attributes[key] != value {
|
||||
return fmt.Errorf(
|
||||
"%s != %s (actual: %s)", key, value, p.Attributes[key])
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func testAccCheckNotifyListExists(n string, nl *monitor.NotifyList) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
rs, ok := s.RootModule().Resources[n]
|
||||
|
||||
if !ok {
|
||||
return fmt.Errorf("Resource not found: %v", n)
|
||||
}
|
||||
|
||||
id := rs.Primary.ID
|
||||
if id == "" {
|
||||
return fmt.Errorf("ID is not set")
|
||||
}
|
||||
|
||||
client := testAccProvider.Meta().(*ns1.Client)
|
||||
|
||||
foundNl, _, err := client.Notifications.Get(id)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if foundNl.ID != id {
|
||||
return fmt.Errorf("Notify List not found want: %#v, got %#v", id, foundNl)
|
||||
}
|
||||
|
||||
*nl = *foundNl
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func testAccCheckNotifyListDestroy(s *terraform.State) error {
|
||||
client := testAccProvider.Meta().(*ns1.Client)
|
||||
|
||||
for _, rs := range s.RootModule().Resources {
|
||||
if rs.Type != "ns1_notifylist" {
|
||||
continue
|
||||
}
|
||||
|
||||
nl, _, err := client.Notifications.Get(rs.Primary.Attributes["id"])
|
||||
|
||||
if err == nil {
|
||||
return fmt.Errorf("Notify List still exists %#v: %#v", err, nl)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func testAccCheckNotifyListName(nl *monitor.NotifyList, expected string) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
if nl.Name != expected {
|
||||
return fmt.Errorf("Name: got: %#v want: %#v", nl.Name, expected)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
const testAccNotifyListBasic = `
|
||||
resource "ns1_notifylist" "test" {
|
||||
name = "terraform test"
|
||||
notifications = {
|
||||
type = "webhook"
|
||||
config = {
|
||||
url = "http://localhost:9090"
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const testAccNotifyListUpdated = `
|
||||
resource "ns1_notifylist" "test" {
|
||||
name = "terraform test"
|
||||
notifications = {
|
||||
type = "webhook"
|
||||
config = {
|
||||
url = "http://localhost:9091"
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
|
@ -69,7 +69,7 @@ func recordResource() *schema.Resource {
|
|||
"use_client_subnet": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: false,
|
||||
Default: true,
|
||||
},
|
||||
"answers": &schema.Schema{
|
||||
Type: schema.TypeSet,
|
||||
|
@ -264,10 +264,8 @@ func resourceDataToRecord(r *dns.Record, d *schema.ResourceData) error {
|
|||
// if v, ok := d.GetOk("meta"); ok {
|
||||
// metaDynamicToStruct(r.Meta, v)
|
||||
// }
|
||||
if v, ok := d.GetOk("use_client_subnet"); ok {
|
||||
copy := v.(bool)
|
||||
r.UseClientSubnet = ©
|
||||
}
|
||||
useClientSubnet := d.Get("use_client_subnet").(bool)
|
||||
r.UseClientSubnet = &useClientSubnet
|
||||
|
||||
if rawFilters := d.Get("filters").([]interface{}); len(rawFilters) > 0 {
|
||||
f := make([]*filter.Filter, len(rawFilters))
|
||||
|
|
|
@ -26,6 +26,7 @@ func TestAccRecord_basic(t *testing.T) {
|
|||
testAccCheckRecordExists("ns1_record.it", &record),
|
||||
testAccCheckRecordDomain(&record, "test.terraform-record-test.io"),
|
||||
testAccCheckRecordTTL(&record, 60),
|
||||
testAccCheckRecordUseClientSubnet(&record, true),
|
||||
testAccCheckRecordRegionName(&record, []string{"cal"}),
|
||||
// testAccCheckRecordAnswerMetaWeight(&record, 10),
|
||||
testAccCheckRecordAnswerRdata(&record, "test1.terraform-record-test.io"),
|
||||
|
@ -48,6 +49,7 @@ func TestAccRecord_updated(t *testing.T) {
|
|||
testAccCheckRecordExists("ns1_record.it", &record),
|
||||
testAccCheckRecordDomain(&record, "test.terraform-record-test.io"),
|
||||
testAccCheckRecordTTL(&record, 60),
|
||||
testAccCheckRecordUseClientSubnet(&record, true),
|
||||
testAccCheckRecordRegionName(&record, []string{"cal"}),
|
||||
// testAccCheckRecordAnswerMetaWeight(&record, 10),
|
||||
testAccCheckRecordAnswerRdata(&record, "test1.terraform-record-test.io"),
|
||||
|
@ -59,6 +61,7 @@ func TestAccRecord_updated(t *testing.T) {
|
|||
testAccCheckRecordExists("ns1_record.it", &record),
|
||||
testAccCheckRecordDomain(&record, "test.terraform-record-test.io"),
|
||||
testAccCheckRecordTTL(&record, 120),
|
||||
testAccCheckRecordUseClientSubnet(&record, false),
|
||||
testAccCheckRecordRegionName(&record, []string{"ny", "wa"}),
|
||||
// testAccCheckRecordAnswerMetaWeight(&record, 5),
|
||||
testAccCheckRecordAnswerRdata(&record, "test2.terraform-record-test.io"),
|
||||
|
@ -143,6 +146,15 @@ func testAccCheckRecordTTL(r *dns.Record, expected int) resource.TestCheckFunc {
|
|||
}
|
||||
}
|
||||
|
||||
func testAccCheckRecordUseClientSubnet(r *dns.Record, expected bool) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
if *r.UseClientSubnet != expected {
|
||||
return fmt.Errorf("UseClientSubnet: got: %#v want: %#v", *r.UseClientSubnet, expected)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func testAccCheckRecordRegionName(r *dns.Record, expected []string) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
regions := make([]string, len(r.Regions))
|
||||
|
@ -240,7 +252,7 @@ resource "ns1_record" "it" {
|
|||
domain = "test.${ns1_zone.test.zone}"
|
||||
type = "CNAME"
|
||||
ttl = 120
|
||||
use_client_subnet = true
|
||||
use_client_subnet = false
|
||||
|
||||
// meta {
|
||||
// weight = 5
|
||||
|
|
|
@ -1477,7 +1477,14 @@ func getVolumeAttachments(computeClient *gophercloud.ServiceClient, d *schema.Re
|
|||
|
||||
allPages, err := volumeattach.List(computeClient, d.Id()).AllPages()
|
||||
if err != nil {
|
||||
return err
|
||||
if errCode, ok := err.(gophercloud.ErrUnexpectedResponseCode); ok {
|
||||
if errCode.Actual == 403 {
|
||||
log.Printf("[DEBUG] os-volume_attachments disabled.")
|
||||
return nil
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
allVolumeAttachments, err := volumeattach.ExtractVolumeAttachments(allPages)
|
||||
|
|
|
@ -46,6 +46,11 @@ func resourceNetworkingSecGroupV2() *schema.Resource {
|
|||
ForceNew: true,
|
||||
Computed: true,
|
||||
},
|
||||
"delete_default_rules": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -71,11 +76,14 @@ func resourceNetworkingSecGroupV2Create(d *schema.ResourceData, meta interface{}
|
|||
return err
|
||||
}
|
||||
|
||||
// Remove the default rules
|
||||
for _, rule := range security_group.Rules {
|
||||
if err := rules.Delete(networkingClient, rule.ID).ExtractErr(); err != nil {
|
||||
return fmt.Errorf(
|
||||
"There was a problem deleting a default security group rule: %s", err)
|
||||
// Delete the default security group rules if it has been requested.
|
||||
deleteDefaultRules := d.Get("delete_default_rules").(bool)
|
||||
if deleteDefaultRules {
|
||||
for _, rule := range security_group.Rules {
|
||||
if err := rules.Delete(networkingClient, rule.ID).ExtractErr(); err != nil {
|
||||
return fmt.Errorf(
|
||||
"There was a problem deleting a default security group rule: %s", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ func TestAccNetworkingV2SecGroup_basic(t *testing.T) {
|
|||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckNetworkingV2SecGroupExists(
|
||||
"openstack_networking_secgroup_v2.secgroup_1", &security_group),
|
||||
testAccCheckNetworkingV2SecGroupRuleCount(&security_group, 0),
|
||||
testAccCheckNetworkingV2SecGroupRuleCount(&security_group, 2),
|
||||
),
|
||||
},
|
||||
resource.TestStep{
|
||||
|
@ -37,6 +37,26 @@ func TestAccNetworkingV2SecGroup_basic(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestAccNetworkingV2SecGroup_noDefaultRules(t *testing.T) {
|
||||
var security_group groups.SecGroup
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckNetworkingV2SecGroupDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccNetworkingV2SecGroup_noDefaultRules,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckNetworkingV2SecGroupExists(
|
||||
"openstack_networking_secgroup_v2.secgroup_1", &security_group),
|
||||
testAccCheckNetworkingV2SecGroupRuleCount(&security_group, 0),
|
||||
),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func testAccCheckNetworkingV2SecGroupDestroy(s *terraform.State) error {
|
||||
config := testAccProvider.Meta().(*Config)
|
||||
networkingClient, err := config.networkingV2Client(OS_REGION_NAME)
|
||||
|
@ -115,3 +135,11 @@ resource "openstack_networking_secgroup_v2" "secgroup_1" {
|
|||
description = "terraform security group acceptance test"
|
||||
}
|
||||
`
|
||||
|
||||
const testAccNetworkingV2SecGroup_noDefaultRules = `
|
||||
resource "openstack_networking_secgroup_v2" "secgroup_1" {
|
||||
name = "security_group_1"
|
||||
description = "terraform security group acceptance test"
|
||||
delete_default_rules = true
|
||||
}
|
||||
`
|
||||
|
|
|
@ -193,5 +193,13 @@ func getStatusCakeTestInput(d *schema.ResourceData) *statuscake.Test {
|
|||
if v, ok := d.GetOk("port"); ok {
|
||||
test.Port = v.(int)
|
||||
}
|
||||
|
||||
defaultStatusCodes := "204, 205, 206, 303, 400, 401, 403, 404, 405, 406, " +
|
||||
"408, 410, 413, 444, 429, 494, 495, 496, 499, 500, 501, 502, 503, " +
|
||||
"504, 505, 506, 507, 508, 509, 510, 511, 521, 522, 523, 524, 520, " +
|
||||
"598, 599"
|
||||
|
||||
test.StatusCodes = defaultStatusCodes
|
||||
|
||||
return test
|
||||
}
|
||||
|
|
|
@ -237,6 +237,12 @@ func (m *Meta) backendConfig(opts *BackendOpts) (*config.Backend, error) {
|
|||
backend.RawConfig = backend.RawConfig.Merge(rc)
|
||||
}
|
||||
|
||||
// Validate the backend early. We have to do this before the normal
|
||||
// config validation pass since backend loading happens earlier.
|
||||
if errs := backend.Validate(); len(errs) > 0 {
|
||||
return nil, multierror.Append(nil, errs...)
|
||||
}
|
||||
|
||||
// Return the configuration which may or may not be set
|
||||
return backend, nil
|
||||
}
|
||||
|
|
|
@ -267,6 +267,24 @@ func TestMetaBackend_emptyLegacyRemote(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// Verify that interpolations result in an error
|
||||
func TestMetaBackend_configureInterpolation(t *testing.T) {
|
||||
// Create a temporary working directory that is empty
|
||||
td := tempDir(t)
|
||||
copy.CopyDir(testFixturePath("backend-new-interp"), td)
|
||||
defer os.RemoveAll(td)
|
||||
defer testChdir(t, td)()
|
||||
|
||||
// Setup the meta
|
||||
m := testMetaBackend(t, nil)
|
||||
|
||||
// Get the backend
|
||||
_, err := m.Backend(&BackendOpts{Init: true})
|
||||
if err == nil {
|
||||
t.Fatal("should error")
|
||||
}
|
||||
}
|
||||
|
||||
// Newly configured backend
|
||||
func TestMetaBackend_configureNew(t *testing.T) {
|
||||
// Create a temporary working directory that is empty
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
variable "foo" { default = "bar" }
|
||||
|
||||
terraform {
|
||||
backend "local" {
|
||||
path = "${var.foo}"
|
||||
}
|
||||
}
|
|
@ -35,7 +35,7 @@ func azureFactory(conf map[string]string) (Client, error) {
|
|||
if !ok {
|
||||
resourceGroupName, ok := conf["resource_group_name"]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("missing 'resource_group' configuration")
|
||||
return nil, fmt.Errorf("missing 'resource_group_name' configuration")
|
||||
}
|
||||
|
||||
var err error
|
||||
|
|
|
@ -665,6 +665,12 @@ func (c *Context) Validate() ([]string, []error) {
|
|||
|
||||
// Return the result
|
||||
rerrs := multierror.Append(errs, walker.ValidationErrors...)
|
||||
|
||||
sort.Strings(walker.ValidationWarnings)
|
||||
sort.Slice(rerrs.Errors, func(i, j int) bool {
|
||||
return rerrs.Errors[i].Error() < rerrs.Errors[j].Error()
|
||||
})
|
||||
|
||||
return walker.ValidationWarnings, rerrs.Errors
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package cdn
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
|
|
|
@ -18,7 +18,7 @@ package containerregistry
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package containerregistry
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package containerregistry
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package containerregistry
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Package containerservice implements the Azure ARM Containerservice service
|
||||
// API version 2016-09-30.
|
||||
// API version 2017-01-31.
|
||||
//
|
||||
// The Container Service Client.
|
||||
package containerservice
|
||||
|
@ -18,7 +18,7 @@ package containerservice
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
@ -28,7 +28,7 @@ import (
|
|||
|
||||
const (
|
||||
// APIVersion is the version of the Containerservice
|
||||
APIVersion = "2016-09-30"
|
||||
APIVersion = "2017-01-31"
|
||||
|
||||
// DefaultBaseURI is the default URI used for the service Containerservice
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
|
|
2
vendor/github.com/Azure/azure-sdk-for-go/arm/containerservice/containerservices.go
generated
vendored
2
vendor/github.com/Azure/azure-sdk-for-go/arm/containerservice/containerservices.go
generated
vendored
|
@ -14,7 +14,7 @@ package containerservice
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package containerservice
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package containerservice
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
|
@ -41,7 +41,7 @@ var (
|
|||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
if userAgent == "" {
|
||||
userAgent = fmt.Sprintf(userAgentFormat, Version(), "containerservice", "2016-09-30")
|
||||
userAgent = fmt.Sprintf(userAgentFormat, Version(), "containerservice", "2017-01-31")
|
||||
}
|
||||
return userAgent
|
||||
}
|
||||
|
|
|
@ -14,30 +14,47 @@ package eventhub
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
patch = "0"
|
||||
// Always begin a "tag" with a dash (as per http://semver.org)
|
||||
tag = "-beta"
|
||||
semVerFormat = "%s.%s.%s%s"
|
||||
userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
|
||||
major = "8"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
)
|
||||
|
||||
// cached results of UserAgent and Version to prevent repeated operations.
|
||||
var (
|
||||
userAgent string
|
||||
version string
|
||||
)
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return fmt.Sprintf(userAgentFormat, Version(), "eventhub", "2015-08-01")
|
||||
if userAgent == "" {
|
||||
userAgent = fmt.Sprintf(userAgentFormat, Version(), "eventhub", "2015-08-01")
|
||||
}
|
||||
return userAgent
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
|
||||
if version == "" {
|
||||
versionBuilder := bytes.NewBufferString(fmt.Sprintf("%s.%s.%s", major, minor, patch))
|
||||
if tag != "" {
|
||||
versionBuilder.WriteRune('-')
|
||||
versionBuilder.WriteString(strings.TrimPrefix(tag, "-"))
|
||||
}
|
||||
version = string(versionBuilder.Bytes())
|
||||
}
|
||||
return version
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package keyvault
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package keyvault
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package keyvault
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package keyvault
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
|
|
|
@ -14,30 +14,47 @@ package network
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
patch = "0"
|
||||
// Always begin a "tag" with a dash (as per http://semver.org)
|
||||
tag = "-beta"
|
||||
semVerFormat = "%s.%s.%s%s"
|
||||
userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
|
||||
major = "8"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
)
|
||||
|
||||
// cached results of UserAgent and Version to prevent repeated operations.
|
||||
var (
|
||||
userAgent string
|
||||
version string
|
||||
)
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return fmt.Sprintf(userAgentFormat, Version(), "network", "2016-09-01")
|
||||
if userAgent == "" {
|
||||
userAgent = fmt.Sprintf(userAgentFormat, Version(), "network", "2016-09-01")
|
||||
}
|
||||
return userAgent
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
|
||||
if version == "" {
|
||||
versionBuilder := bytes.NewBufferString(fmt.Sprintf("%s.%s.%s", major, minor, patch))
|
||||
if tag != "" {
|
||||
versionBuilder.WriteRune('-')
|
||||
versionBuilder.WriteString(strings.TrimPrefix(tag, "-"))
|
||||
}
|
||||
version = string(versionBuilder.Bytes())
|
||||
}
|
||||
return version
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ package redis
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
|
|
|
@ -18,7 +18,7 @@ package resources
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package resources
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
2
vendor/github.com/Azure/azure-sdk-for-go/arm/resources/resources/deployments.go
generated
vendored
2
vendor/github.com/Azure/azure-sdk-for-go/arm/resources/resources/deployments.go
generated
vendored
|
@ -14,7 +14,7 @@ package resources
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package resources
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package resources
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package resources
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
5
vendor/github.com/Azure/azure-sdk-for-go/arm/resources/resources/resourcesgroup.go
generated
vendored
5
vendor/github.com/Azure/azure-sdk-for-go/arm/resources/resources/resourcesgroup.go
generated
vendored
|
@ -14,16 +14,15 @@ package resources
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/autorest/validation"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// GroupClient is the provides operations for working with resources and
|
||||
|
|
|
@ -14,7 +14,7 @@ package resources
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package resources
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
|
|
|
@ -18,7 +18,7 @@ package scheduler
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package scheduler
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package scheduler
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package scheduler
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package scheduler
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
|
|
|
@ -14,7 +14,7 @@ package servicebus
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
|
|
|
@ -14,30 +14,47 @@ package storage
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
patch = "0"
|
||||
// Always begin a "tag" with a dash (as per http://semver.org)
|
||||
tag = "-beta"
|
||||
semVerFormat = "%s.%s.%s%s"
|
||||
userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
|
||||
major = "8"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
)
|
||||
|
||||
// cached results of UserAgent and Version to prevent repeated operations.
|
||||
var (
|
||||
userAgent string
|
||||
version string
|
||||
)
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return fmt.Sprintf(userAgentFormat, Version(), "storage", "2016-01-01")
|
||||
if userAgent == "" {
|
||||
userAgent = fmt.Sprintf(userAgentFormat, Version(), "storage", "2016-01-01")
|
||||
}
|
||||
return userAgent
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
|
||||
if version == "" {
|
||||
versionBuilder := bytes.NewBufferString(fmt.Sprintf("%s.%s.%s", major, minor, patch))
|
||||
if tag != "" {
|
||||
versionBuilder.WriteRune('-')
|
||||
versionBuilder.WriteString(strings.TrimPrefix(tag, "-"))
|
||||
}
|
||||
version = string(versionBuilder.Bytes())
|
||||
}
|
||||
return version
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ package trafficmanager
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package trafficmanager
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package trafficmanager
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package trafficmanager
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ package trafficmanager
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
|
||||
// Changes may cause incorrect behavior and will be lost if the code is
|
||||
// regenerated.
|
||||
|
||||
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
const (
|
||||
major = "8"
|
||||
minor = "0"
|
||||
minor = "1"
|
||||
patch = "0"
|
||||
tag = "beta"
|
||||
userAgentFormat = "Azure-SDK-For-Go/%s arm-%s/%s"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package storage
|
||||
|
||||
var (
|
||||
sdkVersion = "8.0.0-beta"
|
||||
sdkVersion = "8.1.0-beta"
|
||||
)
|
||||
|
|
|
@ -1,3 +1,78 @@
|
|||
|
||||
Release v1.7.3 (2017-02-28)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
* `service/mturk`: Renaming service
|
||||
* service/mechanicalturkrequesterservice was renamed to service/mturk. Be sure to change any references of the old client to the new.
|
||||
|
||||
Release v1.7.2 (2017-02-28)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/dynamodb`: Updates service API and documentation
|
||||
* Release notes: Time to Live (TTL) is a feature that allows you to define when items in a table expire and can be purged from the database, so that you don't have to track expired data and delete it manually. With TTL enabled on a DynamoDB table, you can set a timestamp for deletion on a per-item basis, allowing you to limit storage usage to only those records that are relevant.
|
||||
* `service/iam`: Updates service API, documentation, and paginators
|
||||
* This release adds support for AWS Organizations service control policies (SCPs) to SimulatePrincipalPolicy operation. If there are SCPs associated with the simulated user's account, their effect on the result is captured in the OrganizationDecisionDetail element in the EvaluationResult.
|
||||
* `service/mechanicalturkrequesterservice`: Adds new service
|
||||
* Amazon Mechanical Turk is a web service that provides an on-demand, scalable, human workforce to complete jobs that humans can do better than computers, for example, recognizing objects in photos.
|
||||
* `service/organizations`: Adds new service
|
||||
* AWS Organizations is a web service that enables you to consolidate your multiple AWS accounts into an organization and centrally manage your accounts and their resources.
|
||||
* `service/dynamodbstreams`: Updates service API, documentation, and paginators
|
||||
* `service/waf`: Updates service API, documentation, and paginators
|
||||
* Aws WAF - For GetSampledRequests action, changed max number of samples from 100 to 500.
|
||||
* `service/wafregional`: Updates service API, documentation, and paginators
|
||||
|
||||
Release v1.7.1 (2017-02-24)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/elasticsearchservice`: Updates service API, documentation, paginators, and examples
|
||||
* Added three new API calls to existing Amazon Elasticsearch service to expose Amazon Elasticsearch imposed limits to customers.
|
||||
|
||||
Release v1.7.0 (2017-02-23)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/ec2`: Updates service API
|
||||
* New EC2 I3 instance type
|
||||
|
||||
SDK Bug
|
||||
---
|
||||
* `service/s3/s3manager`: Adding support for SSE (#1097)
|
||||
* Fixes SSE fields not being applied to a part during multi part upload.
|
||||
|
||||
SDK Feature
|
||||
---
|
||||
* `aws/session`: Add support for AssumeRoles with MFA (#1088)
|
||||
* Adds support for assuming IAM roles with MFA enabled. A TokenProvider func was added to stscreds.AssumeRoleProvider that will be called each time the role's credentials need to be refreshed. A basic token provider that sources the MFA token from stdin as stscreds.StdinTokenProvider.
|
||||
* `aws/session`: Update SDK examples and docs to use session.Must (#1099)
|
||||
* Updates the SDK's example and docs to use session.Must where possible to highlight its usage as apposed to session error checking that is most cases errors will be terminal to the application anyways.
|
||||
Release v1.6.27 (2017-02-22)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/clouddirectory`: Updates service documentation
|
||||
* ListObjectAttributes documentation updated based on forum feedback
|
||||
* `service/elasticbeanstalk`: Updates service API, documentation, and paginators
|
||||
* Elastic Beanstalk adds support for creating and managing custom platform.
|
||||
* `service/gamelift`: Updates service API, documentation, and paginators
|
||||
* Allow developers to configure global queues for creating GameSessions. Allow PlayerData on PlayerSessions to store player-specific data.
|
||||
* `service/route53`: Updates service API, documentation, and examples
|
||||
* Added support for operations CreateVPCAssociationAuthorization and DeleteVPCAssociationAuthorization to throw a ConcurrentModification error when a conflicting modification occurs in parallel to the authorizations in place for a given hosted zone.
|
||||
|
||||
Release v1.6.26 (2017-02-21)
|
||||
===
|
||||
|
||||
Service Client Updates
|
||||
---
|
||||
* `service/ec2`: Updates service API and documentation
|
||||
* Added the billingProduct parameter to the RegisterImage API.
|
||||
|
||||
Release v1.6.25 (2017-02-17)
|
||||
===
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ These two processes will still include the `vendor` folder and it should be dele
|
|||
## Getting Help
|
||||
|
||||
Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests.
|
||||
* Ask a question on [StackOverflow](http://stackoverflow.com/) and tag it with the `aws-sdk-go` tag.
|
||||
* Ask a question on [StackOverflow](http://stackoverflow.com/) and tag it with the [`aws-sdk-go`](http://stackoverflow.com/questions/tagged/aws-sdk-go) tag.
|
||||
* Come join the AWS SDK for Go community chat on [gitter](https://gitter.im/aws/aws-sdk-go).
|
||||
* Open a support ticket with [AWS Support](http://docs.aws.amazon.com/awssupport/latest/user/getting-started.html).
|
||||
* If you think you may of found a bug, please open an [issue](https://github.com/aws/aws-sdk-go/issues/new).
|
||||
|
|
|
@ -22,9 +22,9 @@ type RequestRetryer interface{}
|
|||
//
|
||||
// // Create Session with MaxRetry configuration to be shared by multiple
|
||||
// // service clients.
|
||||
// sess, err := session.NewSession(&aws.Config{
|
||||
// sess := session.Must(session.NewSession(&aws.Config{
|
||||
// MaxRetries: aws.Int(3),
|
||||
// })
|
||||
// }))
|
||||
//
|
||||
// // Create S3 service client with a specific Region.
|
||||
// svc := s3.New(sess, &aws.Config{
|
||||
|
@ -154,7 +154,8 @@ type Config struct {
|
|||
// the EC2Metadata overriding the timeout for default credentials chain.
|
||||
//
|
||||
// Example:
|
||||
// sess, err := session.NewSession(aws.NewConfig().WithEC2MetadataDiableTimeoutOverride(true))
|
||||
// sess := session.Must(session.NewSession(aws.NewConfig()
|
||||
// .WithEC2MetadataDiableTimeoutOverride(true)))
|
||||
//
|
||||
// svc := s3.New(sess)
|
||||
//
|
||||
|
@ -174,7 +175,7 @@ type Config struct {
|
|||
//
|
||||
// Only supported with.
|
||||
//
|
||||
// sess, err := session.NewSession()
|
||||
// sess := session.Must(session.NewSession())
|
||||
//
|
||||
// svc := s3.New(sess, &aws.Config{
|
||||
// UseDualStack: aws.Bool(true),
|
||||
|
@ -192,7 +193,9 @@ type Config struct {
|
|||
// Will default to false. This would only be used for empty directory names in s3 requests.
|
||||
//
|
||||
// Example:
|
||||
// sess, err := session.NewSession(&aws.Config{DisableRestProtocolURICleaning: aws.Bool(true))
|
||||
// sess := session.Must(session.NewSession(&aws.Config{
|
||||
// DisableRestProtocolURICleaning: aws.Bool(true),
|
||||
// }))
|
||||
//
|
||||
// svc := s3.New(sess)
|
||||
// out, err := svc.GetObject(&s3.GetObjectInput {
|
||||
|
@ -207,9 +210,9 @@ type Config struct {
|
|||
//
|
||||
// // Create Session with MaxRetry configuration to be shared by multiple
|
||||
// // service clients.
|
||||
// sess, err := session.NewSession(aws.NewConfig().
|
||||
// sess := session.Must(session.NewSession(aws.NewConfig().
|
||||
// WithMaxRetries(3),
|
||||
// )
|
||||
// ))
|
||||
//
|
||||
// // Create S3 service client with a specific Region.
|
||||
// svc := s3.New(sess, aws.NewConfig().
|
||||
|
|
159
vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
generated
vendored
159
vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
generated
vendored
|
@ -1,7 +1,81 @@
|
|||
// Package stscreds are credential Providers to retrieve STS AWS credentials.
|
||||
//
|
||||
// STS provides multiple ways to retrieve credentials which can be used when making
|
||||
// future AWS service API operation calls.
|
||||
/*
|
||||
Package stscreds are credential Providers to retrieve STS AWS credentials.
|
||||
|
||||
STS provides multiple ways to retrieve credentials which can be used when making
|
||||
future AWS service API operation calls.
|
||||
|
||||
The SDK will ensure that per instance of credentials.Credentials all requests
|
||||
to refresh the credentials will be synchronized. But, the SDK is unable to
|
||||
ensure synchronous usage of the AssumeRoleProvider if the value is shared
|
||||
between multiple Credentials, Sessions or service clients.
|
||||
|
||||
Assume Role
|
||||
|
||||
To assume an IAM role using STS with the SDK you can create a new Credentials
|
||||
with the SDKs's stscreds package.
|
||||
|
||||
// Initial credentials loaded from SDK's default credential chain. Such as
|
||||
// the environment, shared credentials (~/.aws/credentials), or EC2 Instance
|
||||
// Role. These credentials will be used to to make the STS Assume Role API.
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
// Create the credentials from AssumeRoleProvider to assume the role
|
||||
// referenced by the "myRoleARN" ARN.
|
||||
creds := stscreds.NewCredentials(sess, "myRoleArn")
|
||||
|
||||
// Create service client value configured for credentials
|
||||
// from assumed role.
|
||||
svc := s3.New(sess, &aws.Config{Credentials: creds})
|
||||
|
||||
Assume Role with static MFA Token
|
||||
|
||||
To assume an IAM role with a MFA token you can either specify a MFA token code
|
||||
directly or provide a function to prompt the user each time the credentials
|
||||
need to refresh the role's credentials. Specifying the TokenCode should be used
|
||||
for short lived operations that will not need to be refreshed, and when you do
|
||||
not want to have direct control over the user provides their MFA token.
|
||||
|
||||
With TokenCode the AssumeRoleProvider will be not be able to refresh the role's
|
||||
credentials.
|
||||
|
||||
// Create the credentials from AssumeRoleProvider to assume the role
|
||||
// referenced by the "myRoleARN" ARN using the MFA token code provided.
|
||||
creds := stscreds.NewCredentials(sess, "myRoleArn", func(p *stscreds.AssumeRoleProvider) {
|
||||
p.SerialNumber = aws.String("myTokenSerialNumber")
|
||||
p.TokenCode = aws.String("00000000")
|
||||
})
|
||||
|
||||
// Create service client value configured for credentials
|
||||
// from assumed role.
|
||||
svc := s3.New(sess, &aws.Config{Credentials: creds})
|
||||
|
||||
Assume Role with MFA Token Provider
|
||||
|
||||
To assume an IAM role with MFA for longer running tasks where the credentials
|
||||
may need to be refreshed setting the TokenProvider field of AssumeRoleProvider
|
||||
will allow the credential provider to prompt for new MFA token code when the
|
||||
role's credentials need to be refreshed.
|
||||
|
||||
The StdinTokenProvider function is available to prompt on stdin to retrieve
|
||||
the MFA token code from the user. You can also implement custom prompts by
|
||||
satisfing the TokenProvider function signature.
|
||||
|
||||
Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will
|
||||
have undesirable results as the StdinTokenProvider will not be synchronized. A
|
||||
single Credentials with an AssumeRoleProvider can be shared safely.
|
||||
|
||||
// Create the credentials from AssumeRoleProvider to assume the role
|
||||
// referenced by the "myRoleARN" ARN. Prompting for MFA token from stdin.
|
||||
creds := stscreds.NewCredentials(sess, "myRoleArn", func(p *stscreds.AssumeRoleProvider) {
|
||||
p.SerialNumber = aws.String("myTokenSerialNumber")
|
||||
p.TokenProvider = stscreds.StdinTokenProvider
|
||||
})
|
||||
|
||||
// Create service client value configured for credentials
|
||||
// from assumed role.
|
||||
svc := s3.New(sess, &aws.Config{Credentials: creds})
|
||||
|
||||
*/
|
||||
package stscreds
|
||||
|
||||
import (
|
||||
|
@ -9,11 +83,31 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||
"github.com/aws/aws-sdk-go/service/sts"
|
||||
)
|
||||
|
||||
// StdinTokenProvider will prompt on stdout and read from stdin for a string value.
|
||||
// An error is returned if reading from stdin fails.
|
||||
//
|
||||
// Use this function go read MFA tokens from stdin. The function makes no attempt
|
||||
// to make atomic prompts from stdin across multiple gorouties.
|
||||
//
|
||||
// Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will
|
||||
// have undesirable results as the StdinTokenProvider will not be synchronized. A
|
||||
// single Credentials with an AssumeRoleProvider can be shared safely
|
||||
//
|
||||
// Will wait forever until something is provided on the stdin.
|
||||
func StdinTokenProvider() (string, error) {
|
||||
var v string
|
||||
fmt.Printf("Assume Role MFA token code: ")
|
||||
_, err := fmt.Scanln(&v)
|
||||
|
||||
return v, err
|
||||
}
|
||||
|
||||
// ProviderName provides a name of AssumeRole provider
|
||||
const ProviderName = "AssumeRoleProvider"
|
||||
|
||||
|
@ -27,8 +121,15 @@ type AssumeRoler interface {
|
|||
var DefaultDuration = time.Duration(15) * time.Minute
|
||||
|
||||
// AssumeRoleProvider retrieves temporary credentials from the STS service, and
|
||||
// keeps track of their expiration time. This provider must be used explicitly,
|
||||
// as it is not included in the credentials chain.
|
||||
// keeps track of their expiration time.
|
||||
//
|
||||
// This credential provider will be used by the SDKs default credential change
|
||||
// when shared configuration is enabled, and the shared config or shared credentials
|
||||
// file configure assume role. See Session docs for how to do this.
|
||||
//
|
||||
// AssumeRoleProvider does not provide any synchronization and it is not safe
|
||||
// to share this value across multiple Credentials, Sessions, or service clients
|
||||
// without also sharing the same Credentials instance.
|
||||
type AssumeRoleProvider struct {
|
||||
credentials.Expiry
|
||||
|
||||
|
@ -65,8 +166,23 @@ type AssumeRoleProvider struct {
|
|||
// assumed requires MFA (that is, if the policy includes a condition that tests
|
||||
// for MFA). If the role being assumed requires MFA and if the TokenCode value
|
||||
// is missing or expired, the AssumeRole call returns an "access denied" error.
|
||||
//
|
||||
// If SerialNumber is set and neither TokenCode nor TokenProvider are also
|
||||
// set an error will be returned.
|
||||
TokenCode *string
|
||||
|
||||
// Async method of providing MFA token code for assuming an IAM role with MFA.
|
||||
// The value returned by the function will be used as the TokenCode in the Retrieve
|
||||
// call. See StdinTokenProvider for a provider that prompts and reads from stdin.
|
||||
//
|
||||
// This token provider will be called when ever the assumed role's
|
||||
// credentials need to be refreshed when SerialNumber is also set and
|
||||
// TokenCode is not set.
|
||||
//
|
||||
// If both TokenCode and TokenProvider is set, TokenProvider will be used and
|
||||
// TokenCode is ignored.
|
||||
TokenProvider func() (string, error)
|
||||
|
||||
// ExpiryWindow will allow the credentials to trigger refreshing prior to
|
||||
// the credentials actually expiring. This is beneficial so race conditions
|
||||
// with expiring credentials do not cause request to fail unexpectedly
|
||||
|
@ -85,6 +201,10 @@ type AssumeRoleProvider struct {
|
|||
//
|
||||
// Takes a Config provider to create the STS client. The ConfigProvider is
|
||||
// satisfied by the session.Session type.
|
||||
//
|
||||
// It is safe to share the returned Credentials with multiple Sessions and
|
||||
// service clients. All access to the credentials and refreshing them
|
||||
// will be synchronized.
|
||||
func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {
|
||||
p := &AssumeRoleProvider{
|
||||
Client: sts.New(c),
|
||||
|
@ -103,7 +223,11 @@ func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*As
|
|||
// AssumeRoleProvider. The credentials will expire every 15 minutes and the
|
||||
// role will be named after a nanosecond timestamp of this operation.
|
||||
//
|
||||
// Takes an AssumeRoler which can be satisfiede by the STS client.
|
||||
// Takes an AssumeRoler which can be satisfied by the STS client.
|
||||
//
|
||||
// It is safe to share the returned Credentials with multiple Sessions and
|
||||
// service clients. All access to the credentials and refreshing them
|
||||
// will be synchronized.
|
||||
func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {
|
||||
p := &AssumeRoleProvider{
|
||||
Client: svc,
|
||||
|
@ -139,12 +263,25 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {
|
|||
if p.Policy != nil {
|
||||
input.Policy = p.Policy
|
||||
}
|
||||
if p.SerialNumber != nil && p.TokenCode != nil {
|
||||
input.SerialNumber = p.SerialNumber
|
||||
input.TokenCode = p.TokenCode
|
||||
if p.SerialNumber != nil {
|
||||
if p.TokenCode != nil {
|
||||
input.SerialNumber = p.SerialNumber
|
||||
input.TokenCode = p.TokenCode
|
||||
} else if p.TokenProvider != nil {
|
||||
input.SerialNumber = p.SerialNumber
|
||||
code, err := p.TokenProvider()
|
||||
if err != nil {
|
||||
return credentials.Value{ProviderName: ProviderName}, err
|
||||
}
|
||||
input.TokenCode = aws.String(code)
|
||||
} else {
|
||||
return credentials.Value{ProviderName: ProviderName},
|
||||
awserr.New("AssumeRoleTokenNotAvailable",
|
||||
"assume role with MFA enabled, but neither TokenCode nor TokenProvider are set", nil)
|
||||
}
|
||||
}
|
||||
roleOutput, err := p.Client.AssumeRole(input)
|
||||
|
||||
roleOutput, err := p.Client.AssumeRole(input)
|
||||
if err != nil {
|
||||
return credentials.Value{ProviderName: ProviderName}, err
|
||||
}
|
||||
|
|
|
@ -45,16 +45,16 @@ region, and profile loaded from the environment and shared config automatically.
|
|||
Requires the AWS_PROFILE to be set, or "default" is used.
|
||||
|
||||
// Create Session
|
||||
sess, err := session.NewSession()
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
// Create a Session with a custom region
|
||||
sess, err := session.NewSession(&aws.Config{Region: aws.String("us-east-1")})
|
||||
sess := session.Must(session.NewSession(&aws.Config{
|
||||
Region: aws.String("us-east-1"),
|
||||
}))
|
||||
|
||||
// Create a S3 client instance from a session
|
||||
sess, err := session.NewSession()
|
||||
if err != nil {
|
||||
// Handle Session creation error
|
||||
}
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := s3.New(sess)
|
||||
|
||||
Create Session With Option Overrides
|
||||
|
@ -67,23 +67,25 @@ Use NewSessionWithOptions when you want to provide the config profile, or
|
|||
override the shared config state (AWS_SDK_LOAD_CONFIG).
|
||||
|
||||
// Equivalent to session.NewSession()
|
||||
sess, err := session.NewSessionWithOptions(session.Options{})
|
||||
sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
// Options
|
||||
}))
|
||||
|
||||
// Specify profile to load for the session's config
|
||||
sess, err := session.NewSessionWithOptions(session.Options{
|
||||
sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
Profile: "profile_name",
|
||||
})
|
||||
}))
|
||||
|
||||
// Specify profile for config and region for requests
|
||||
sess, err := session.NewSessionWithOptions(session.Options{
|
||||
sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
Config: aws.Config{Region: aws.String("us-east-1")},
|
||||
Profile: "profile_name",
|
||||
})
|
||||
}))
|
||||
|
||||
// Force enable Shared Config support
|
||||
sess, err := session.NewSessionWithOptions(session.Options{
|
||||
sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
SharedConfigState: SharedConfigEnable,
|
||||
})
|
||||
}))
|
||||
|
||||
Adding Handlers
|
||||
|
||||
|
@ -93,7 +95,8 @@ handler logs every request and its payload made by a service client:
|
|||
|
||||
// Create a session, and add additional handlers for all service
|
||||
// clients created with the Session to inherit. Adds logging handler.
|
||||
sess, err := session.NewSession()
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
sess.Handlers.Send.PushFront(func(r *request.Request) {
|
||||
// Log every request made and its payload
|
||||
logger.Println("Request: %s/%s, Payload: %s",
|
||||
|
@ -138,15 +141,14 @@ the other two fields are also provided.
|
|||
|
||||
Assume Role values allow you to configure the SDK to assume an IAM role using
|
||||
a set of credentials provided in a config file via the source_profile field.
|
||||
Both "role_arn" and "source_profile" are required. The SDK does not support
|
||||
assuming a role with MFA token Via the Session's constructor. You can use the
|
||||
stscreds.AssumeRoleProvider credentials provider to specify custom
|
||||
configuration and support for MFA.
|
||||
Both "role_arn" and "source_profile" are required. The SDK supports assuming
|
||||
a role with MFA token if the session option AssumeRoleTokenProvider
|
||||
is set.
|
||||
|
||||
role_arn = arn:aws:iam::<account_number>:role/<role_name>
|
||||
source_profile = profile_with_creds
|
||||
external_id = 1234
|
||||
mfa_serial = not supported!
|
||||
mfa_serial = <serial or mfa arn>
|
||||
role_session_name = session_name
|
||||
|
||||
Region is the region the SDK should use for looking up AWS service endpoints
|
||||
|
@ -154,6 +156,37 @@ and signing requests.
|
|||
|
||||
region = us-east-1
|
||||
|
||||
Assume Role with MFA token
|
||||
|
||||
To create a session with support for assuming an IAM role with MFA set the
|
||||
session option AssumeRoleTokenProvider to a function that will prompt for the
|
||||
MFA token code when the SDK assumes the role and refreshes the role's credentials.
|
||||
This allows you to configure the SDK via the shared config to assumea role
|
||||
with MFA tokens.
|
||||
|
||||
In order for the SDK to assume a role with MFA the SharedConfigState
|
||||
session option must be set to SharedConfigEnable, or AWS_SDK_LOAD_CONFIG
|
||||
environment variable set.
|
||||
|
||||
The shared configuration instructs the SDK to assume an IAM role with MFA
|
||||
when the mfa_serial configuration field is set in the shared config
|
||||
(~/.aws/config) or shared credentials (~/.aws/credentials) file.
|
||||
|
||||
If mfa_serial is set in the configuration, the SDK will assume the role, and
|
||||
the AssumeRoleTokenProvider session option is not set an an error will
|
||||
be returned when creating the session.
|
||||
|
||||
sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
AssumeRoleTokenProvider: stscreds.StdinTokenProvider,
|
||||
}))
|
||||
|
||||
// Create service client value configured for credentials
|
||||
// from assumed role.
|
||||
svc := s3.New(sess)
|
||||
|
||||
To setup assume role outside of a session see the stscrds.AssumeRoleProvider
|
||||
documentation.
|
||||
|
||||
Environment Variables
|
||||
|
||||
When a Session is created several environment variables can be set to adjust
|
||||
|
|
|
@ -52,7 +52,7 @@ func New(cfgs ...*aws.Config) *Session {
|
|||
envCfg := loadEnvConfig()
|
||||
|
||||
if envCfg.EnableSharedConfig {
|
||||
s, err := newSession(envCfg, cfgs...)
|
||||
s, err := newSession(Options{}, envCfg, cfgs...)
|
||||
if err != nil {
|
||||
// Old session.New expected all errors to be discovered when
|
||||
// a request is made, and would report the errors then. This
|
||||
|
@ -73,7 +73,7 @@ func New(cfgs ...*aws.Config) *Session {
|
|||
return s
|
||||
}
|
||||
|
||||
return oldNewSession(cfgs...)
|
||||
return deprecatedNewSession(cfgs...)
|
||||
}
|
||||
|
||||
// NewSession returns a new Session created from SDK defaults, config files,
|
||||
|
@ -94,7 +94,7 @@ func New(cfgs ...*aws.Config) *Session {
|
|||
func NewSession(cfgs ...*aws.Config) (*Session, error) {
|
||||
envCfg := loadEnvConfig()
|
||||
|
||||
return newSession(envCfg, cfgs...)
|
||||
return newSession(Options{}, envCfg, cfgs...)
|
||||
}
|
||||
|
||||
// SharedConfigState provides the ability to optionally override the state
|
||||
|
@ -147,6 +147,26 @@ type Options struct {
|
|||
// will allow you to override the AWS_SDK_LOAD_CONFIG environment variable
|
||||
// and enable or disable the shared config functionality.
|
||||
SharedConfigState SharedConfigState
|
||||
|
||||
// When the SDK's shared config is configured to assume a role with MFA
|
||||
// this option is required in order to provide the mechanism that will
|
||||
// retrieve the MFA token. There is no default value for this field. If
|
||||
// it is not set an error will be returned when creating the session.
|
||||
//
|
||||
// This token provider will be called when ever the assumed role's
|
||||
// credentials need to be refreshed. Within the context of service clients
|
||||
// all sharing the same session the SDK will ensure calls to the token
|
||||
// provider are atomic. When sharing a token provider across multiple
|
||||
// sessions additional synchronization logic is needed to ensure the
|
||||
// token providers do not introduce race conditions. It is recommend to
|
||||
// share the session where possible.
|
||||
//
|
||||
// stscreds.StdinTokenProvider is a basic implementation that will prompt
|
||||
// from stdin for the MFA token code.
|
||||
//
|
||||
// This field is only used if the shared configuration is enabled, and
|
||||
// the config enables assume role wit MFA via the mfa_serial field.
|
||||
AssumeRoleTokenProvider func() (string, error)
|
||||
}
|
||||
|
||||
// NewSessionWithOptions returns a new Session created from SDK defaults, config files,
|
||||
|
@ -161,23 +181,23 @@ type Options struct {
|
|||
// to be built with retrieving credentials with AssumeRole set in the config.
|
||||
//
|
||||
// // Equivalent to session.New
|
||||
// sess, err := session.NewSessionWithOptions(session.Options{})
|
||||
// sess := session.Must(session.NewSessionWithOptions(session.Options{}))
|
||||
//
|
||||
// // Specify profile to load for the session's config
|
||||
// sess, err := session.NewSessionWithOptions(session.Options{
|
||||
// sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
// Profile: "profile_name",
|
||||
// })
|
||||
// }))
|
||||
//
|
||||
// // Specify profile for config and region for requests
|
||||
// sess, err := session.NewSessionWithOptions(session.Options{
|
||||
// sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
// Config: aws.Config{Region: aws.String("us-east-1")},
|
||||
// Profile: "profile_name",
|
||||
// })
|
||||
// }))
|
||||
//
|
||||
// // Force enable Shared Config support
|
||||
// sess, err := session.NewSessionWithOptions(session.Options{
|
||||
// sess := session.Must(session.NewSessionWithOptions(session.Options{
|
||||
// SharedConfigState: SharedConfigEnable,
|
||||
// })
|
||||
// }))
|
||||
func NewSessionWithOptions(opts Options) (*Session, error) {
|
||||
var envCfg envConfig
|
||||
if opts.SharedConfigState == SharedConfigEnable {
|
||||
|
@ -197,7 +217,7 @@ func NewSessionWithOptions(opts Options) (*Session, error) {
|
|||
envCfg.EnableSharedConfig = true
|
||||
}
|
||||
|
||||
return newSession(envCfg, &opts.Config)
|
||||
return newSession(opts, envCfg, &opts.Config)
|
||||
}
|
||||
|
||||
// Must is a helper function to ensure the Session is valid and there was no
|
||||
|
@ -215,7 +235,7 @@ func Must(sess *Session, err error) *Session {
|
|||
return sess
|
||||
}
|
||||
|
||||
func oldNewSession(cfgs ...*aws.Config) *Session {
|
||||
func deprecatedNewSession(cfgs ...*aws.Config) *Session {
|
||||
cfg := defaults.Config()
|
||||
handlers := defaults.Handlers()
|
||||
|
||||
|
@ -242,7 +262,7 @@ func oldNewSession(cfgs ...*aws.Config) *Session {
|
|||
return s
|
||||
}
|
||||
|
||||
func newSession(envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
|
||||
func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
|
||||
cfg := defaults.Config()
|
||||
handlers := defaults.Handlers()
|
||||
|
||||
|
@ -266,7 +286,9 @@ func newSession(envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers)
|
||||
if err := mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers, opts); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s := &Session{
|
||||
Config: cfg,
|
||||
|
@ -278,7 +300,7 @@ func newSession(envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
|
|||
return s, nil
|
||||
}
|
||||
|
||||
func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers) {
|
||||
func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, sessOpts Options) error {
|
||||
// Merge in user provided configuration
|
||||
cfg.MergeIn(userCfg)
|
||||
|
||||
|
@ -302,6 +324,11 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share
|
|||
cfgCp.Credentials = credentials.NewStaticCredentialsFromCreds(
|
||||
sharedCfg.AssumeRoleSource.Creds,
|
||||
)
|
||||
if len(sharedCfg.AssumeRole.MFASerial) > 0 && sessOpts.AssumeRoleTokenProvider == nil {
|
||||
// AssumeRole Token provider is required if doing Assume Role
|
||||
// with MFA.
|
||||
return AssumeRoleTokenProviderNotSetError{}
|
||||
}
|
||||
cfg.Credentials = stscreds.NewCredentials(
|
||||
&Session{
|
||||
Config: &cfgCp,
|
||||
|
@ -311,11 +338,16 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share
|
|||
func(opt *stscreds.AssumeRoleProvider) {
|
||||
opt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName
|
||||
|
||||
// Assume role with external ID
|
||||
if len(sharedCfg.AssumeRole.ExternalID) > 0 {
|
||||
opt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID)
|
||||
}
|
||||
|
||||
// MFA not supported
|
||||
// Assume role with MFA
|
||||
if len(sharedCfg.AssumeRole.MFASerial) > 0 {
|
||||
opt.SerialNumber = aws.String(sharedCfg.AssumeRole.MFASerial)
|
||||
opt.TokenProvider = sessOpts.AssumeRoleTokenProvider
|
||||
}
|
||||
},
|
||||
)
|
||||
} else if len(sharedCfg.Creds.AccessKeyID) > 0 {
|
||||
|
@ -336,6 +368,33 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// AssumeRoleTokenProviderNotSetError is an error returned when creating a session when the
|
||||
// MFAToken option is not set when shared config is configured load assume a
|
||||
// role with an MFA token.
|
||||
type AssumeRoleTokenProviderNotSetError struct{}
|
||||
|
||||
// Code is the short id of the error.
|
||||
func (e AssumeRoleTokenProviderNotSetError) Code() string {
|
||||
return "AssumeRoleTokenProviderNotSetError"
|
||||
}
|
||||
|
||||
// Message is the description of the error
|
||||
func (e AssumeRoleTokenProviderNotSetError) Message() string {
|
||||
return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.")
|
||||
}
|
||||
|
||||
// OrigErr is the underlying error that caused the failure.
|
||||
func (e AssumeRoleTokenProviderNotSetError) OrigErr() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Error satisfies the error interface.
|
||||
func (e AssumeRoleTokenProviderNotSetError) Error() string {
|
||||
return awserr.SprintError(e.Code(), e.Message(), "", nil)
|
||||
}
|
||||
|
||||
type credProviderError struct {
|
||||
|
|
|
@ -5,4 +5,4 @@ package aws
|
|||
const SDKName = "aws-sdk-go"
|
||||
|
||||
// SDKVersion is the version of this SDK
|
||||
const SDKVersion = "1.6.25"
|
||||
const SDKVersion = "1.7.3"
|
||||
|
|
|
@ -808,6 +808,75 @@ func (c *DynamoDB) DescribeTable(input *DescribeTableInput) (*DescribeTableOutpu
|
|||
return out, err
|
||||
}
|
||||
|
||||
const opDescribeTimeToLive = "DescribeTimeToLive"
|
||||
|
||||
// DescribeTimeToLiveRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DescribeTimeToLive operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
//
|
||||
// See DescribeTimeToLive for usage and error information.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DescribeTimeToLive method directly
|
||||
// instead.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DescribeTimeToLiveRequest method.
|
||||
// req, resp := client.DescribeTimeToLiveRequest(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLive
|
||||
func (c *DynamoDB) DescribeTimeToLiveRequest(input *DescribeTimeToLiveInput) (req *request.Request, output *DescribeTimeToLiveOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opDescribeTimeToLive,
|
||||
HTTPMethod: "POST",
|
||||
HTTPPath: "/",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &DescribeTimeToLiveInput{}
|
||||
}
|
||||
|
||||
output = &DescribeTimeToLiveOutput{}
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
// DescribeTimeToLive API operation for Amazon DynamoDB.
|
||||
//
|
||||
// Gives a description of the Time to Live (TTL) status on the specified table.
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
//
|
||||
// See the AWS API reference guide for Amazon DynamoDB's
|
||||
// API operation DescribeTimeToLive for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
|
||||
// The operation tried to access a nonexistent table or index. The resource
|
||||
// might not be specified correctly, or its status might not be ACTIVE.
|
||||
//
|
||||
// * ErrCodeInternalServerError "InternalServerError"
|
||||
// An error occurred on the server side.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLive
|
||||
func (c *DynamoDB) DescribeTimeToLive(input *DescribeTimeToLiveInput) (*DescribeTimeToLiveOutput, error) {
|
||||
req, out := c.DescribeTimeToLiveRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
}
|
||||
|
||||
const opGetItem = "GetItem"
|
||||
|
||||
// GetItemRequest generates a "aws/request.Request" representing the
|
||||
|
@ -1804,6 +1873,117 @@ func (c *DynamoDB) UpdateTable(input *UpdateTableInput) (*UpdateTableOutput, err
|
|||
return out, err
|
||||
}
|
||||
|
||||
const opUpdateTimeToLive = "UpdateTimeToLive"
|
||||
|
||||
// UpdateTimeToLiveRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the UpdateTimeToLive operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
//
|
||||
// See UpdateTimeToLive for usage and error information.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the UpdateTimeToLive method directly
|
||||
// instead.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the UpdateTimeToLiveRequest method.
|
||||
// req, resp := client.UpdateTimeToLiveRequest(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLive
|
||||
func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *request.Request, output *UpdateTimeToLiveOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opUpdateTimeToLive,
|
||||
HTTPMethod: "POST",
|
||||
HTTPPath: "/",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &UpdateTimeToLiveInput{}
|
||||
}
|
||||
|
||||
output = &UpdateTimeToLiveOutput{}
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateTimeToLive API operation for Amazon DynamoDB.
|
||||
//
|
||||
// Specify the lifetime of individual table items. The database automatically
|
||||
// removes the item at the expiration of the item. The UpdateTimeToLive method
|
||||
// will enable or disable TTL for the specified table. A successful UpdateTimeToLive
|
||||
// call returns the current TimeToLiveSpecification; it may take up to one hour
|
||||
// for the change to fully process.
|
||||
//
|
||||
// TTL compares the current time in epoch time format to the time stored in
|
||||
// the TTL attribute of an item. If the epoch time value stored in the attribute
|
||||
// is less than the current time, the item is marked as expired and subsequently
|
||||
// deleted.
|
||||
//
|
||||
// The epoch time format is the number of seconds elapsed since 12:00:00 AM
|
||||
// January 1st, 1970 UTC.
|
||||
//
|
||||
// DynamoDB deletes expired items on a best-effort basis to ensure availability
|
||||
// of throughput for other data operations.
|
||||
//
|
||||
// DynamoDB typically deletes expired items within two days of expiration. The
|
||||
// exact duration within which an item gets deleted after expiration is specific
|
||||
// to the nature of the workload. Items that have expired and not been deleted
|
||||
// will still show up in reads, queries, and scans.
|
||||
//
|
||||
// As items are deleted, they are removed from any Local Secondary Index and
|
||||
// Global Secondary Index immediately in the same eventually consistent way
|
||||
// as a standard delete operation.
|
||||
//
|
||||
// For more information, see Time To Live (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html)
|
||||
// in the Amazon DynamoDB Developer Guide.
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
//
|
||||
// See the AWS API reference guide for Amazon DynamoDB's
|
||||
// API operation UpdateTimeToLive for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * ErrCodeResourceInUseException "ResourceInUseException"
|
||||
// The operation conflicts with the resource's availability. For example, you
|
||||
// attempted to recreate an existing table, or tried to delete a table currently
|
||||
// in the CREATING state.
|
||||
//
|
||||
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
|
||||
// The operation tried to access a nonexistent table or index. The resource
|
||||
// might not be specified correctly, or its status might not be ACTIVE.
|
||||
//
|
||||
// * ErrCodeLimitExceededException "LimitExceededException"
|
||||
// The number of concurrent table requests (cumulative number of tables in the
|
||||
// CREATING, DELETING or UPDATING state) exceeds the maximum allowed of 10.
|
||||
//
|
||||
// Also, for tables with secondary indexes, only one of those tables can be
|
||||
// in the CREATING state at any point in time. Do not attempt to create more
|
||||
// than one such table simultaneously.
|
||||
//
|
||||
// The total limit of tables in the ACTIVE state is 250.
|
||||
//
|
||||
// * ErrCodeInternalServerError "InternalServerError"
|
||||
// An error occurred on the server side.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLive
|
||||
func (c *DynamoDB) UpdateTimeToLive(input *UpdateTimeToLiveInput) (*UpdateTimeToLiveOutput, error) {
|
||||
req, out := c.UpdateTimeToLiveRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
}
|
||||
|
||||
// Represents an attribute for describing the key schema for the table and indexes.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/AttributeDefinition
|
||||
type AttributeDefinition struct {
|
||||
|
@ -3207,7 +3387,7 @@ type DeleteItemInput struct {
|
|||
//
|
||||
// These function names are case-sensitive.
|
||||
//
|
||||
// * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
|
||||
// * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
|
||||
//
|
||||
// * Logical operators: AND | OR | NOT
|
||||
//
|
||||
|
@ -3733,6 +3913,71 @@ func (s *DescribeTableOutput) SetTable(v *TableDescription) *DescribeTableOutput
|
|||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLiveInput
|
||||
type DescribeTimeToLiveInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// The name of the table to be described.
|
||||
//
|
||||
// TableName is a required field
|
||||
TableName *string `min:"3" type:"string" required:"true"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s DescribeTimeToLiveInput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s DescribeTimeToLiveInput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// Validate inspects the fields of the type to determine if they are valid.
|
||||
func (s *DescribeTimeToLiveInput) Validate() error {
|
||||
invalidParams := request.ErrInvalidParams{Context: "DescribeTimeToLiveInput"}
|
||||
if s.TableName == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("TableName"))
|
||||
}
|
||||
if s.TableName != nil && len(*s.TableName) < 3 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetTableName sets the TableName field's value.
|
||||
func (s *DescribeTimeToLiveInput) SetTableName(v string) *DescribeTimeToLiveInput {
|
||||
s.TableName = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLiveOutput
|
||||
type DescribeTimeToLiveOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
TimeToLiveDescription *TimeToLiveDescription `type:"structure"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s DescribeTimeToLiveOutput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s DescribeTimeToLiveOutput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetTimeToLiveDescription sets the TimeToLiveDescription field's value.
|
||||
func (s *DescribeTimeToLiveOutput) SetTimeToLiveDescription(v *TimeToLiveDescription) *DescribeTimeToLiveOutput {
|
||||
s.TimeToLiveDescription = v
|
||||
return s
|
||||
}
|
||||
|
||||
// Represents a condition to be compared with an attribute value. This condition
|
||||
// can be used with DeleteItem, PutItem or UpdateItem operations; if the comparison
|
||||
// evaluates to true, the operation succeeds; if not, the operation fails. You
|
||||
|
@ -5308,7 +5553,7 @@ type PutItemInput struct {
|
|||
//
|
||||
// These function names are case-sensitive.
|
||||
//
|
||||
// * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
|
||||
// * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
|
||||
//
|
||||
// * Logical operators: AND | OR | NOT
|
||||
//
|
||||
|
@ -7151,6 +7396,100 @@ func (s TagResourceOutput) GoString() string {
|
|||
return s.String()
|
||||
}
|
||||
|
||||
// The description of the Time to Live (TTL) status on the specified table.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TimeToLiveDescription
|
||||
type TimeToLiveDescription struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// The name of the Time to Live attribute for items in the table.
|
||||
AttributeName *string `min:"1" type:"string"`
|
||||
|
||||
// The Time to Live status for the table.
|
||||
TimeToLiveStatus *string `type:"string" enum:"TimeToLiveStatus"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s TimeToLiveDescription) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s TimeToLiveDescription) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetAttributeName sets the AttributeName field's value.
|
||||
func (s *TimeToLiveDescription) SetAttributeName(v string) *TimeToLiveDescription {
|
||||
s.AttributeName = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTimeToLiveStatus sets the TimeToLiveStatus field's value.
|
||||
func (s *TimeToLiveDescription) SetTimeToLiveStatus(v string) *TimeToLiveDescription {
|
||||
s.TimeToLiveStatus = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Represents the settings used to enable or disable Time to Live for the specified
|
||||
// table.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TimeToLiveSpecification
|
||||
type TimeToLiveSpecification struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// The name of the Time to Live attribute used to store the expiration time
|
||||
// for items in the table.
|
||||
//
|
||||
// AttributeName is a required field
|
||||
AttributeName *string `min:"1" type:"string" required:"true"`
|
||||
|
||||
// Indicates whether Time To Live is to be enabled (true) or disabled (false)
|
||||
// on the table.
|
||||
//
|
||||
// Enabled is a required field
|
||||
Enabled *bool `type:"boolean" required:"true"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s TimeToLiveSpecification) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s TimeToLiveSpecification) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// Validate inspects the fields of the type to determine if they are valid.
|
||||
func (s *TimeToLiveSpecification) Validate() error {
|
||||
invalidParams := request.ErrInvalidParams{Context: "TimeToLiveSpecification"}
|
||||
if s.AttributeName == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("AttributeName"))
|
||||
}
|
||||
if s.AttributeName != nil && len(*s.AttributeName) < 1 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1))
|
||||
}
|
||||
if s.Enabled == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("Enabled"))
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetAttributeName sets the AttributeName field's value.
|
||||
func (s *TimeToLiveSpecification) SetAttributeName(v string) *TimeToLiveSpecification {
|
||||
s.AttributeName = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetEnabled sets the Enabled field's value.
|
||||
func (s *TimeToLiveSpecification) SetEnabled(v bool) *TimeToLiveSpecification {
|
||||
s.Enabled = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UntagResourceInput
|
||||
type UntagResourceInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
@ -7311,7 +7650,7 @@ type UpdateItemInput struct {
|
|||
//
|
||||
// These function names are case-sensitive.
|
||||
//
|
||||
// * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
|
||||
// * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
|
||||
//
|
||||
// * Logical operators: AND | OR | NOT
|
||||
//
|
||||
|
@ -7430,14 +7769,17 @@ type UpdateItemInput struct {
|
|||
// * NONE - If ReturnValues is not specified, or if its value is NONE, then
|
||||
// nothing is returned. (This setting is the default for ReturnValues.)
|
||||
//
|
||||
// * ALL_OLD - If UpdateItem overwrote an attribute name-value pair, then
|
||||
// the content of the old item is returned.
|
||||
// * ALL_OLD - Returns all of the attributes of the item, as they appeared
|
||||
// before the UpdateItem operation.
|
||||
//
|
||||
// * UPDATED_OLD - The old versions of only the updated attributes are returned.
|
||||
// * UPDATED_OLD - Returns only the updated attributes, as they appeared
|
||||
// before the UpdateItem operation.
|
||||
//
|
||||
// * ALL_NEW - All of the attributes of the new version of the item are returned.
|
||||
// * ALL_NEW - Returns all of the attributes of the item, as they appear
|
||||
// after the UpdateItem operation.
|
||||
//
|
||||
// * UPDATED_NEW - The new versions of only the updated attributes are returned.
|
||||
// * UPDATED_NEW - Returns only the updated attributes, as they appear after
|
||||
// the UpdateItem operation.
|
||||
//
|
||||
// There is no additional cost associated with requesting a return value aside
|
||||
// from the small network and processing overhead of receiving a larger response.
|
||||
|
@ -7842,6 +8184,93 @@ func (s *UpdateTableOutput) SetTableDescription(v *TableDescription) *UpdateTabl
|
|||
return s
|
||||
}
|
||||
|
||||
// Represents the input of an UpdateTimeToLive operation.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLiveInput
|
||||
type UpdateTimeToLiveInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// The name of the table to be configured.
|
||||
//
|
||||
// TableName is a required field
|
||||
TableName *string `min:"3" type:"string" required:"true"`
|
||||
|
||||
// Represents the settings used to enable or disable Time to Live for the specified
|
||||
// table.
|
||||
//
|
||||
// TimeToLiveSpecification is a required field
|
||||
TimeToLiveSpecification *TimeToLiveSpecification `type:"structure" required:"true"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s UpdateTimeToLiveInput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s UpdateTimeToLiveInput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// Validate inspects the fields of the type to determine if they are valid.
|
||||
func (s *UpdateTimeToLiveInput) Validate() error {
|
||||
invalidParams := request.ErrInvalidParams{Context: "UpdateTimeToLiveInput"}
|
||||
if s.TableName == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("TableName"))
|
||||
}
|
||||
if s.TableName != nil && len(*s.TableName) < 3 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
|
||||
}
|
||||
if s.TimeToLiveSpecification == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("TimeToLiveSpecification"))
|
||||
}
|
||||
if s.TimeToLiveSpecification != nil {
|
||||
if err := s.TimeToLiveSpecification.Validate(); err != nil {
|
||||
invalidParams.AddNested("TimeToLiveSpecification", err.(request.ErrInvalidParams))
|
||||
}
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetTableName sets the TableName field's value.
|
||||
func (s *UpdateTimeToLiveInput) SetTableName(v string) *UpdateTimeToLiveInput {
|
||||
s.TableName = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTimeToLiveSpecification sets the TimeToLiveSpecification field's value.
|
||||
func (s *UpdateTimeToLiveInput) SetTimeToLiveSpecification(v *TimeToLiveSpecification) *UpdateTimeToLiveInput {
|
||||
s.TimeToLiveSpecification = v
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLiveOutput
|
||||
type UpdateTimeToLiveOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// Represents the output of an UpdateTimeToLive operation.
|
||||
TimeToLiveSpecification *TimeToLiveSpecification `type:"structure"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s UpdateTimeToLiveOutput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s UpdateTimeToLiveOutput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetTimeToLiveSpecification sets the TimeToLiveSpecification field's value.
|
||||
func (s *UpdateTimeToLiveOutput) SetTimeToLiveSpecification(v *TimeToLiveSpecification) *UpdateTimeToLiveOutput {
|
||||
s.TimeToLiveSpecification = v
|
||||
return s
|
||||
}
|
||||
|
||||
// Represents an operation to perform - either DeleteItem or PutItem. You can
|
||||
// only request one of these operations, not both, in a single WriteRequest.
|
||||
// If you do need to perform both of these operations, you will need to provide
|
||||
|
@ -8075,3 +8504,17 @@ const (
|
|||
// TableStatusActive is a TableStatus enum value
|
||||
TableStatusActive = "ACTIVE"
|
||||
)
|
||||
|
||||
const (
|
||||
// TimeToLiveStatusEnabling is a TimeToLiveStatus enum value
|
||||
TimeToLiveStatusEnabling = "ENABLING"
|
||||
|
||||
// TimeToLiveStatusDisabling is a TimeToLiveStatus enum value
|
||||
TimeToLiveStatusDisabling = "DISABLING"
|
||||
|
||||
// TimeToLiveStatusEnabled is a TimeToLiveStatus enum value
|
||||
TimeToLiveStatusEnabled = "ENABLED"
|
||||
|
||||
// TimeToLiveStatusDisabled is a TimeToLiveStatus enum value
|
||||
TimeToLiveStatusDisabled = "DISABLED"
|
||||
)
|
||||
|
|
|
@ -9921,7 +9921,7 @@ func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModifica
|
|||
//
|
||||
// You can also use CloudWatch Events to check the status of a modification
|
||||
// to an EBS volume. For information about CloudWatch Events, see the Amazon
|
||||
// CloudWatch Events User Guide (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html).
|
||||
// CloudWatch Events User Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/).
|
||||
// For more information, see Monitoring Volume Modifications" (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
|
@ -13080,30 +13080,29 @@ func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Reques
|
|||
// without stopping the instance or detaching the volume from it. For more information
|
||||
// about modifying an EBS volume running Linux, see Modifying the Size, IOPS,
|
||||
// or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html).
|
||||
// For more information about modifying an EBS volume running Windows, see Expanding
|
||||
// the Storage Space of an EBS Volume on Windows (http://docs.aws.amazon.com/docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html).
|
||||
// For more information about modifying an EBS volume running Windows, see Modifying
|
||||
// the Size, IOPS, or Type of an EBS Volume on Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html).
|
||||
//
|
||||
// When you complete a resize operation on your volume, you need to extend the
|
||||
// volume's file-system size to take advantage of the new storage capacity.
|
||||
// For information about extending a Linux file system, see Extending a Linux
|
||||
// File System (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#recognize-expanded-volume-linux).
|
||||
// For information about extending a Windows file system, see Extending a Windows
|
||||
// File System (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows).
|
||||
// File System (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows).
|
||||
//
|
||||
// You can use CloudWatch Events to check the status of a modification to an
|
||||
// EBS volume. For information about CloudWatch Events, see the Amazon CloudWatch
|
||||
// Events User Guide (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html).
|
||||
// Events User Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/).
|
||||
// You can also track the status of a modification using the DescribeVolumesModifications
|
||||
// (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVolumesModifications.html)
|
||||
// API. For information about tracking status changes using either method, see
|
||||
// Monitoring Volume Modifications" (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods).
|
||||
// Monitoring Volume Modifications (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods).
|
||||
//
|
||||
// With previous-generation volumes and instance types, resizing an EBS volume
|
||||
// may require detaching and reattaching the volume or stopping and restarting
|
||||
// the instance. For more information about modifying an EBS volume running
|
||||
// Linux, see Modifying the Size, IOPS, or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html).
|
||||
// With previous-generation instance types, resizing an EBS volume may require
|
||||
// detaching and reattaching the volume or stopping and restarting the instance.
|
||||
// For more information about modifying an EBS volume running Linux, see Modifying
|
||||
// the Size, IOPS, or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html).
|
||||
// For more information about modifying an EBS volume running Windows, see Modifying
|
||||
// the Size, IOPS, or Type of an EBS Volume on Windows (http://docs.aws.amazon.com/docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html).
|
||||
// the Size, IOPS, or Type of an EBS Volume on Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html).
|
||||
//
|
||||
// If you reach the maximum volume modification rate per volume limit, you will
|
||||
// need to wait at least six hours before applying further modifications to
|
||||
|
@ -13854,31 +13853,27 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ
|
|||
// in a single request, so you don't have to register the AMI yourself.
|
||||
//
|
||||
// You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from
|
||||
// a snapshot of a root device volume. For more information, see Launching an
|
||||
// Instance from a Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_LaunchingInstanceFromSnapshot.html)
|
||||
// a snapshot of a root device volume. You specify the snapshot using the block
|
||||
// device mapping. For more information, see Launching an Instance from a Snapshot
|
||||
// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_LaunchingInstanceFromSnapshot.html)
|
||||
// in the Amazon Elastic Compute Cloud User Guide.
|
||||
//
|
||||
// You can't register an image where a secondary (non-root) snapshot has AWS
|
||||
// Marketplace product codes.
|
||||
//
|
||||
// Some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE
|
||||
// Linux Enterprise Server (SLES), use the EC2 billingProduct code associated
|
||||
// with an AMI to verify subscription status for package updates. Creating an
|
||||
// AMI from an EBS snapshot does not maintain this billing code, and subsequent
|
||||
// Linux Enterprise Server (SLES), use the EC2 billing product code associated
|
||||
// with an AMI to verify the subscription status for package updates. Creating
|
||||
// an AMI from an EBS snapshot does not maintain this billing code, and subsequent
|
||||
// instances launched from such an AMI will not be able to connect to package
|
||||
// update infrastructure.
|
||||
//
|
||||
// Similarly, although you can create a Windows AMI from a snapshot, you can't
|
||||
// successfully launch an instance from the AMI.
|
||||
//
|
||||
// To create Windows AMIs or to create AMIs for Linux operating systems that
|
||||
// must retain AMI billing codes to work properly, see CreateImage.
|
||||
// update infrastructure. To create an AMI that must retain billing codes, see
|
||||
// CreateImage.
|
||||
//
|
||||
// If needed, you can deregister an AMI at any time. Any modifications you make
|
||||
// to an AMI backed by an instance store volume invalidates its registration.
|
||||
// If you make changes to an image, deregister the previous image and register
|
||||
// the new image.
|
||||
//
|
||||
// You can't register an image where a secondary (non-root) snapshot has AWS
|
||||
// Marketplace product codes.
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
|
@ -40467,6 +40462,8 @@ type ModifyVolumeInput struct {
|
|||
// Only valid for Provisioned IOPS SSD (io1) volumes. For more information about
|
||||
// io1 IOPS configuration, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops
|
||||
// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops).
|
||||
//
|
||||
// Default: If no IOPS value is specified, the existing value is retained.
|
||||
Iops *int64 `type:"integer"`
|
||||
|
||||
// Target size in GiB of the volume to be modified. Target volume size must
|
||||
|
@ -40482,10 +40479,10 @@ type ModifyVolumeInput struct {
|
|||
|
||||
// Target EBS volume type of the volume to be modified
|
||||
//
|
||||
// Valid values are io1 | gp2 | sc1 | st1
|
||||
//
|
||||
// The API does not support modifications for volume type standard. You also
|
||||
// cannot change the type of a volume to standard.
|
||||
//
|
||||
// Default: If no type is specified, the existing type is retained.
|
||||
VolumeType *string `type:"string" enum:"VolumeType"`
|
||||
}
|
||||
|
||||
|
@ -43248,6 +43245,9 @@ type RegisterImageInput struct {
|
|||
// the architecture specified in the manifest file.
|
||||
Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"`
|
||||
|
||||
// The billing product codes.
|
||||
BillingProducts []*string `locationName:"BillingProduct" locationNameList:"item" type:"list"`
|
||||
|
||||
// One or more block device mapping entries.
|
||||
BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"`
|
||||
|
||||
|
@ -43333,6 +43333,12 @@ func (s *RegisterImageInput) SetArchitecture(v string) *RegisterImageInput {
|
|||
return s
|
||||
}
|
||||
|
||||
// SetBillingProducts sets the BillingProducts field's value.
|
||||
func (s *RegisterImageInput) SetBillingProducts(v []*string) *RegisterImageInput {
|
||||
s.BillingProducts = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetBlockDeviceMappings sets the BlockDeviceMappings field's value.
|
||||
func (s *RegisterImageInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *RegisterImageInput {
|
||||
s.BlockDeviceMappings = v
|
||||
|
@ -51527,8 +51533,8 @@ type VolumeModification struct {
|
|||
// Modification completion or failure time.
|
||||
EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"`
|
||||
|
||||
// Current state of modification. Possible values are modifying | optimizing
|
||||
// | complete | failed. Modification state is null for unmodified volumes.
|
||||
// Current state of modification. Modification state is null for unmodified
|
||||
// volumes.
|
||||
ModificationState *string `locationName:"modificationState" type:"string" enum:"VolumeModificationState"`
|
||||
|
||||
// Original IOPS rate of the volume being modified.
|
||||
|
@ -53314,6 +53320,24 @@ const (
|
|||
// InstanceTypeI28xlarge is a InstanceType enum value
|
||||
InstanceTypeI28xlarge = "i2.8xlarge"
|
||||
|
||||
// InstanceTypeI3Large is a InstanceType enum value
|
||||
InstanceTypeI3Large = "i3.large"
|
||||
|
||||
// InstanceTypeI3Xlarge is a InstanceType enum value
|
||||
InstanceTypeI3Xlarge = "i3.xlarge"
|
||||
|
||||
// InstanceTypeI32xlarge is a InstanceType enum value
|
||||
InstanceTypeI32xlarge = "i3.2xlarge"
|
||||
|
||||
// InstanceTypeI34xlarge is a InstanceType enum value
|
||||
InstanceTypeI34xlarge = "i3.4xlarge"
|
||||
|
||||
// InstanceTypeI38xlarge is a InstanceType enum value
|
||||
InstanceTypeI38xlarge = "i3.8xlarge"
|
||||
|
||||
// InstanceTypeI316xlarge is a InstanceType enum value
|
||||
InstanceTypeI316xlarge = "i3.16xlarge"
|
||||
|
||||
// InstanceTypeHi14xlarge is a InstanceType enum value
|
||||
InstanceTypeHi14xlarge = "hi1.4xlarge"
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -37,6 +37,13 @@ const (
|
|||
// effects an element in this activity is already in progress.
|
||||
ErrCodeOperationInProgressException = "OperationInProgressFailure"
|
||||
|
||||
// ErrCodePlatformVersionStillReferencedException for service response error code
|
||||
// "PlatformVersionStillReferencedException".
|
||||
//
|
||||
// You cannot delete the platform version because there are still environments
|
||||
// running on it.
|
||||
ErrCodePlatformVersionStillReferencedException = "PlatformVersionStillReferencedException"
|
||||
|
||||
// ErrCodeS3LocationNotInServiceRegionException for service response error code
|
||||
// "S3LocationNotInServiceRegionException".
|
||||
//
|
||||
|
@ -98,4 +105,11 @@ const (
|
|||
//
|
||||
// The specified account has reached its limit of environments.
|
||||
ErrCodeTooManyEnvironmentsException = "TooManyEnvironmentsException"
|
||||
|
||||
// ErrCodeTooManyPlatformsException for service response error code
|
||||
// "TooManyPlatformsException".
|
||||
//
|
||||
// You have exceeded the maximum number of allowed platforms associated with
|
||||
// the account.
|
||||
ErrCodeTooManyPlatformsException = "TooManyPlatformsException"
|
||||
)
|
||||
|
|
|
@ -500,6 +500,94 @@ func (c *ElasticsearchService) DescribeElasticsearchDomains(input *DescribeElast
|
|||
return out, err
|
||||
}
|
||||
|
||||
const opDescribeElasticsearchInstanceTypeLimits = "DescribeElasticsearchInstanceTypeLimits"
|
||||
|
||||
// DescribeElasticsearchInstanceTypeLimitsRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DescribeElasticsearchInstanceTypeLimits operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
//
|
||||
// See DescribeElasticsearchInstanceTypeLimits for usage and error information.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DescribeElasticsearchInstanceTypeLimits method directly
|
||||
// instead.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DescribeElasticsearchInstanceTypeLimitsRequest method.
|
||||
// req, resp := client.DescribeElasticsearchInstanceTypeLimitsRequest(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimits
|
||||
func (c *ElasticsearchService) DescribeElasticsearchInstanceTypeLimitsRequest(input *DescribeElasticsearchInstanceTypeLimitsInput) (req *request.Request, output *DescribeElasticsearchInstanceTypeLimitsOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opDescribeElasticsearchInstanceTypeLimits,
|
||||
HTTPMethod: "GET",
|
||||
HTTPPath: "/2015-01-01/es/instanceTypeLimits/{ElasticsearchVersion}/{InstanceType}",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &DescribeElasticsearchInstanceTypeLimitsInput{}
|
||||
}
|
||||
|
||||
output = &DescribeElasticsearchInstanceTypeLimitsOutput{}
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
// DescribeElasticsearchInstanceTypeLimits API operation for Amazon Elasticsearch Service.
|
||||
//
|
||||
// Describe Elasticsearch Limits for a given InstanceType and ElasticsearchVersion.
|
||||
// When modifying existing Domain, specify the DomainName to know what Limits
|
||||
// are supported for modifying.
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
//
|
||||
// See the AWS API reference guide for Amazon Elasticsearch Service's
|
||||
// API operation DescribeElasticsearchInstanceTypeLimits for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * ErrCodeBaseException "BaseException"
|
||||
// An error occurred while processing the request.
|
||||
//
|
||||
// * ErrCodeInternalException "InternalException"
|
||||
// The request processing has failed because of an unknown error, exception
|
||||
// or failure (the failure is internal to the service) . Gives http status code
|
||||
// of 500.
|
||||
//
|
||||
// * ErrCodeInvalidTypeException "InvalidTypeException"
|
||||
// An exception for trying to create or access sub-resource that is either invalid
|
||||
// or not supported. Gives http status code of 409.
|
||||
//
|
||||
// * ErrCodeLimitExceededException "LimitExceededException"
|
||||
// An exception for trying to create more than allowed resources or sub-resources.
|
||||
// Gives http status code of 409.
|
||||
//
|
||||
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
|
||||
// An exception for accessing or deleting a resource that does not exist. Gives
|
||||
// http status code of 400.
|
||||
//
|
||||
// * ErrCodeValidationException "ValidationException"
|
||||
// An exception for missing / invalid input fields. Gives http status code of
|
||||
// 400.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimits
|
||||
func (c *ElasticsearchService) DescribeElasticsearchInstanceTypeLimits(input *DescribeElasticsearchInstanceTypeLimitsInput) (*DescribeElasticsearchInstanceTypeLimitsOutput, error) {
|
||||
req, out := c.DescribeElasticsearchInstanceTypeLimitsRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
}
|
||||
|
||||
const opListDomainNames = "ListDomainNames"
|
||||
|
||||
// ListDomainNamesRequest generates a "aws/request.Request" representing the
|
||||
|
@ -570,6 +658,224 @@ func (c *ElasticsearchService) ListDomainNames(input *ListDomainNamesInput) (*Li
|
|||
return out, err
|
||||
}
|
||||
|
||||
const opListElasticsearchInstanceTypes = "ListElasticsearchInstanceTypes"
|
||||
|
||||
// ListElasticsearchInstanceTypesRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the ListElasticsearchInstanceTypes operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
//
|
||||
// See ListElasticsearchInstanceTypes for usage and error information.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the ListElasticsearchInstanceTypes method directly
|
||||
// instead.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the ListElasticsearchInstanceTypesRequest method.
|
||||
// req, resp := client.ListElasticsearchInstanceTypesRequest(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypes
|
||||
func (c *ElasticsearchService) ListElasticsearchInstanceTypesRequest(input *ListElasticsearchInstanceTypesInput) (req *request.Request, output *ListElasticsearchInstanceTypesOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opListElasticsearchInstanceTypes,
|
||||
HTTPMethod: "GET",
|
||||
HTTPPath: "/2015-01-01/es/instanceTypes/{ElasticsearchVersion}",
|
||||
Paginator: &request.Paginator{
|
||||
InputTokens: []string{"NextToken"},
|
||||
OutputTokens: []string{"NextToken"},
|
||||
LimitToken: "MaxResults",
|
||||
TruncationToken: "",
|
||||
},
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &ListElasticsearchInstanceTypesInput{}
|
||||
}
|
||||
|
||||
output = &ListElasticsearchInstanceTypesOutput{}
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
// ListElasticsearchInstanceTypes API operation for Amazon Elasticsearch Service.
|
||||
//
|
||||
// List all Elasticsearch instance types that are supported for given ElasticsearchVersion
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
//
|
||||
// See the AWS API reference guide for Amazon Elasticsearch Service's
|
||||
// API operation ListElasticsearchInstanceTypes for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * ErrCodeBaseException "BaseException"
|
||||
// An error occurred while processing the request.
|
||||
//
|
||||
// * ErrCodeInternalException "InternalException"
|
||||
// The request processing has failed because of an unknown error, exception
|
||||
// or failure (the failure is internal to the service) . Gives http status code
|
||||
// of 500.
|
||||
//
|
||||
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
|
||||
// An exception for accessing or deleting a resource that does not exist. Gives
|
||||
// http status code of 400.
|
||||
//
|
||||
// * ErrCodeValidationException "ValidationException"
|
||||
// An exception for missing / invalid input fields. Gives http status code of
|
||||
// 400.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypes
|
||||
func (c *ElasticsearchService) ListElasticsearchInstanceTypes(input *ListElasticsearchInstanceTypesInput) (*ListElasticsearchInstanceTypesOutput, error) {
|
||||
req, out := c.ListElasticsearchInstanceTypesRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
}
|
||||
|
||||
// ListElasticsearchInstanceTypesPages iterates over the pages of a ListElasticsearchInstanceTypes operation,
|
||||
// calling the "fn" function with the response data for each page. To stop
|
||||
// iterating, return false from the fn function.
|
||||
//
|
||||
// See ListElasticsearchInstanceTypes method for more information on how to use this operation.
|
||||
//
|
||||
// Note: This operation can generate multiple requests to a service.
|
||||
//
|
||||
// // Example iterating over at most 3 pages of a ListElasticsearchInstanceTypes operation.
|
||||
// pageNum := 0
|
||||
// err := client.ListElasticsearchInstanceTypesPages(params,
|
||||
// func(page *ListElasticsearchInstanceTypesOutput, lastPage bool) bool {
|
||||
// pageNum++
|
||||
// fmt.Println(page)
|
||||
// return pageNum <= 3
|
||||
// })
|
||||
//
|
||||
func (c *ElasticsearchService) ListElasticsearchInstanceTypesPages(input *ListElasticsearchInstanceTypesInput, fn func(p *ListElasticsearchInstanceTypesOutput, lastPage bool) (shouldContinue bool)) error {
|
||||
page, _ := c.ListElasticsearchInstanceTypesRequest(input)
|
||||
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
|
||||
return page.EachPage(func(p interface{}, lastPage bool) bool {
|
||||
return fn(p.(*ListElasticsearchInstanceTypesOutput), lastPage)
|
||||
})
|
||||
}
|
||||
|
||||
const opListElasticsearchVersions = "ListElasticsearchVersions"
|
||||
|
||||
// ListElasticsearchVersionsRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the ListElasticsearchVersions operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
//
|
||||
// See ListElasticsearchVersions for usage and error information.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the ListElasticsearchVersions method directly
|
||||
// instead.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the ListElasticsearchVersionsRequest method.
|
||||
// req, resp := client.ListElasticsearchVersionsRequest(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersions
|
||||
func (c *ElasticsearchService) ListElasticsearchVersionsRequest(input *ListElasticsearchVersionsInput) (req *request.Request, output *ListElasticsearchVersionsOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opListElasticsearchVersions,
|
||||
HTTPMethod: "GET",
|
||||
HTTPPath: "/2015-01-01/es/versions",
|
||||
Paginator: &request.Paginator{
|
||||
InputTokens: []string{"NextToken"},
|
||||
OutputTokens: []string{"NextToken"},
|
||||
LimitToken: "MaxResults",
|
||||
TruncationToken: "",
|
||||
},
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &ListElasticsearchVersionsInput{}
|
||||
}
|
||||
|
||||
output = &ListElasticsearchVersionsOutput{}
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
// ListElasticsearchVersions API operation for Amazon Elasticsearch Service.
|
||||
//
|
||||
// List all supported Elasticsearch versions
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
//
|
||||
// See the AWS API reference guide for Amazon Elasticsearch Service's
|
||||
// API operation ListElasticsearchVersions for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * ErrCodeBaseException "BaseException"
|
||||
// An error occurred while processing the request.
|
||||
//
|
||||
// * ErrCodeInternalException "InternalException"
|
||||
// The request processing has failed because of an unknown error, exception
|
||||
// or failure (the failure is internal to the service) . Gives http status code
|
||||
// of 500.
|
||||
//
|
||||
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
|
||||
// An exception for accessing or deleting a resource that does not exist. Gives
|
||||
// http status code of 400.
|
||||
//
|
||||
// * ErrCodeValidationException "ValidationException"
|
||||
// An exception for missing / invalid input fields. Gives http status code of
|
||||
// 400.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersions
|
||||
func (c *ElasticsearchService) ListElasticsearchVersions(input *ListElasticsearchVersionsInput) (*ListElasticsearchVersionsOutput, error) {
|
||||
req, out := c.ListElasticsearchVersionsRequest(input)
|
||||
err := req.Send()
|
||||
return out, err
|
||||
}
|
||||
|
||||
// ListElasticsearchVersionsPages iterates over the pages of a ListElasticsearchVersions operation,
|
||||
// calling the "fn" function with the response data for each page. To stop
|
||||
// iterating, return false from the fn function.
|
||||
//
|
||||
// See ListElasticsearchVersions method for more information on how to use this operation.
|
||||
//
|
||||
// Note: This operation can generate multiple requests to a service.
|
||||
//
|
||||
// // Example iterating over at most 3 pages of a ListElasticsearchVersions operation.
|
||||
// pageNum := 0
|
||||
// err := client.ListElasticsearchVersionsPages(params,
|
||||
// func(page *ListElasticsearchVersionsOutput, lastPage bool) bool {
|
||||
// pageNum++
|
||||
// fmt.Println(page)
|
||||
// return pageNum <= 3
|
||||
// })
|
||||
//
|
||||
func (c *ElasticsearchService) ListElasticsearchVersionsPages(input *ListElasticsearchVersionsInput, fn func(p *ListElasticsearchVersionsOutput, lastPage bool) (shouldContinue bool)) error {
|
||||
page, _ := c.ListElasticsearchVersionsRequest(input)
|
||||
page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
|
||||
return page.EachPage(func(p interface{}, lastPage bool) bool {
|
||||
return fn(p.(*ListElasticsearchVersionsOutput), lastPage)
|
||||
})
|
||||
}
|
||||
|
||||
const opListTags = "ListTags"
|
||||
|
||||
// ListTagsRequest generates a "aws/request.Request" representing the
|
||||
|
@ -934,6 +1240,46 @@ func (s AddTagsOutput) GoString() string {
|
|||
return s.String()
|
||||
}
|
||||
|
||||
// List of limits that are specific to a given InstanceType and for each of
|
||||
// it's InstanceRole .
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AdditionalLimit
|
||||
type AdditionalLimit struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// Name of Additional Limit is specific to a given InstanceType and for each
|
||||
// of it's InstanceRole etc. Attributes and their details: MaximumNumberOfDataNodesSupported
|
||||
// This attribute will be present in Master node only to specify how much data
|
||||
// nodes upto which given ESPartitionInstanceTypecan support as master node. MaximumNumberOfDataNodesWithoutMasterNode
|
||||
// This attribute will be present in Data node only to specify how much data
|
||||
// nodes of given ESPartitionInstanceType
|
||||
LimitName *string `type:"string"`
|
||||
|
||||
// Value for given AdditionalLimit$LimitName .
|
||||
LimitValues []*string `type:"list"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s AdditionalLimit) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s AdditionalLimit) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetLimitName sets the LimitName field's value.
|
||||
func (s *AdditionalLimit) SetLimitName(v string) *AdditionalLimit {
|
||||
s.LimitName = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetLimitValues sets the LimitValues field's value.
|
||||
func (s *AdditionalLimit) SetLimitValues(v []*string) *AdditionalLimit {
|
||||
s.LimitValues = v
|
||||
return s
|
||||
}
|
||||
|
||||
// Status of the advanced options for the specified Elasticsearch domain. Currently,
|
||||
// the following advanced options are available:
|
||||
//
|
||||
|
@ -1400,6 +1746,104 @@ func (s *DescribeElasticsearchDomainsOutput) SetDomainStatusList(v []*Elasticsea
|
|||
return s
|
||||
}
|
||||
|
||||
// Container for the parameters to DescribeElasticsearchInstanceTypeLimits operation.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimitsRequest
|
||||
type DescribeElasticsearchInstanceTypeLimitsInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// DomainName represents the name of the Domain that we are trying to modify.
|
||||
// This should be present only if we are querying for Elasticsearch Limits for
|
||||
// existing domain.
|
||||
DomainName *string `location:"querystring" locationName:"domainName" min:"3" type:"string"`
|
||||
|
||||
// Version of Elasticsearch for which Limits are needed.
|
||||
//
|
||||
// ElasticsearchVersion is a required field
|
||||
ElasticsearchVersion *string `location:"uri" locationName:"ElasticsearchVersion" type:"string" required:"true"`
|
||||
|
||||
// The instance type for an Elasticsearch cluster for which Elasticsearch Limits
|
||||
// are needed.
|
||||
//
|
||||
// InstanceType is a required field
|
||||
InstanceType *string `location:"uri" locationName:"InstanceType" type:"string" required:"true" enum:"ESPartitionInstanceType"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s DescribeElasticsearchInstanceTypeLimitsInput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s DescribeElasticsearchInstanceTypeLimitsInput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// Validate inspects the fields of the type to determine if they are valid.
|
||||
func (s *DescribeElasticsearchInstanceTypeLimitsInput) Validate() error {
|
||||
invalidParams := request.ErrInvalidParams{Context: "DescribeElasticsearchInstanceTypeLimitsInput"}
|
||||
if s.DomainName != nil && len(*s.DomainName) < 3 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("DomainName", 3))
|
||||
}
|
||||
if s.ElasticsearchVersion == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("ElasticsearchVersion"))
|
||||
}
|
||||
if s.InstanceType == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("InstanceType"))
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetDomainName sets the DomainName field's value.
|
||||
func (s *DescribeElasticsearchInstanceTypeLimitsInput) SetDomainName(v string) *DescribeElasticsearchInstanceTypeLimitsInput {
|
||||
s.DomainName = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetElasticsearchVersion sets the ElasticsearchVersion field's value.
|
||||
func (s *DescribeElasticsearchInstanceTypeLimitsInput) SetElasticsearchVersion(v string) *DescribeElasticsearchInstanceTypeLimitsInput {
|
||||
s.ElasticsearchVersion = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetInstanceType sets the InstanceType field's value.
|
||||
func (s *DescribeElasticsearchInstanceTypeLimitsInput) SetInstanceType(v string) *DescribeElasticsearchInstanceTypeLimitsInput {
|
||||
s.InstanceType = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Container for the parameters received from DescribeElasticsearchInstanceTypeLimits
|
||||
// operation.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimitsResponse
|
||||
type DescribeElasticsearchInstanceTypeLimitsOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// Map of Role of the Instance and Limits that are applicable. Role performed
|
||||
// by given Instance in Elasticsearch can be one of the following: Data: If
|
||||
// the given InstanceType is used as Data node
|
||||
// Master: If the given InstanceType is used as Master node
|
||||
LimitsByRole map[string]*Limits `type:"map"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s DescribeElasticsearchInstanceTypeLimitsOutput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s DescribeElasticsearchInstanceTypeLimitsOutput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetLimitsByRole sets the LimitsByRole field's value.
|
||||
func (s *DescribeElasticsearchInstanceTypeLimitsOutput) SetLimitsByRole(v map[string]*Limits) *DescribeElasticsearchInstanceTypeLimitsOutput {
|
||||
s.LimitsByRole = v
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DomainInfo
|
||||
type DomainInfo struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
@ -1895,6 +2339,114 @@ func (s *ElasticsearchVersionStatus) SetStatus(v *OptionStatus) *ElasticsearchVe
|
|||
return s
|
||||
}
|
||||
|
||||
// InstanceCountLimits represents the limits on number of instances that be
|
||||
// created in Amazon Elasticsearch for given InstanceType.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/InstanceCountLimits
|
||||
type InstanceCountLimits struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// Maximum number of Instances that can be instantiated for given InstanceType.
|
||||
MaximumInstanceCount *int64 `type:"integer"`
|
||||
|
||||
// Minimum number of Instances that can be instantiated for given InstanceType.
|
||||
MinimumInstanceCount *int64 `type:"integer"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s InstanceCountLimits) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s InstanceCountLimits) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetMaximumInstanceCount sets the MaximumInstanceCount field's value.
|
||||
func (s *InstanceCountLimits) SetMaximumInstanceCount(v int64) *InstanceCountLimits {
|
||||
s.MaximumInstanceCount = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetMinimumInstanceCount sets the MinimumInstanceCount field's value.
|
||||
func (s *InstanceCountLimits) SetMinimumInstanceCount(v int64) *InstanceCountLimits {
|
||||
s.MinimumInstanceCount = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// InstanceLimits represents the list of instance related attributes that are
|
||||
// available for given InstanceType.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/InstanceLimits
|
||||
type InstanceLimits struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// InstanceCountLimits represents the limits on number of instances that be
|
||||
// created in Amazon Elasticsearch for given InstanceType.
|
||||
InstanceCountLimits *InstanceCountLimits `type:"structure"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s InstanceLimits) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s InstanceLimits) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetInstanceCountLimits sets the InstanceCountLimits field's value.
|
||||
func (s *InstanceLimits) SetInstanceCountLimits(v *InstanceCountLimits) *InstanceLimits {
|
||||
s.InstanceCountLimits = v
|
||||
return s
|
||||
}
|
||||
|
||||
// Limits for given InstanceType and for each of it's role. Limits contains following StorageTypes, InstanceLimitsand AdditionalLimits
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/Limits
|
||||
type Limits struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// List of additional limits that are specific to a given InstanceType and for
|
||||
// each of it's InstanceRole .
|
||||
AdditionalLimits []*AdditionalLimit `type:"list"`
|
||||
|
||||
// InstanceLimits represents the list of instance related attributes that are
|
||||
// available for given InstanceType.
|
||||
InstanceLimits *InstanceLimits `type:"structure"`
|
||||
|
||||
// StorageType represents the list of storage related types and attributes that
|
||||
// are available for given InstanceType.
|
||||
StorageTypes []*StorageType `type:"list"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s Limits) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s Limits) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetAdditionalLimits sets the AdditionalLimits field's value.
|
||||
func (s *Limits) SetAdditionalLimits(v []*AdditionalLimit) *Limits {
|
||||
s.AdditionalLimits = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetInstanceLimits sets the InstanceLimits field's value.
|
||||
func (s *Limits) SetInstanceLimits(v *InstanceLimits) *Limits {
|
||||
s.InstanceLimits = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetStorageTypes sets the StorageTypes field's value.
|
||||
func (s *Limits) SetStorageTypes(v []*StorageType) *Limits {
|
||||
s.StorageTypes = v
|
||||
return s
|
||||
}
|
||||
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainNamesInput
|
||||
type ListDomainNamesInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
@ -1936,6 +2488,197 @@ func (s *ListDomainNamesOutput) SetDomainNames(v []*DomainInfo) *ListDomainNames
|
|||
return s
|
||||
}
|
||||
|
||||
// Container for the parameters to the ListElasticsearchInstanceTypes operation.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypesRequest
|
||||
type ListElasticsearchInstanceTypesInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// DomainName represents the name of the Domain that we are trying to modify.
|
||||
// This should be present only if we are querying for list of available Elasticsearch
|
||||
// instance types when modifying existing domain.
|
||||
DomainName *string `location:"querystring" locationName:"domainName" min:"3" type:"string"`
|
||||
|
||||
// Version of Elasticsearch for which list of supported elasticsearch instance
|
||||
// types are needed.
|
||||
//
|
||||
// ElasticsearchVersion is a required field
|
||||
ElasticsearchVersion *string `location:"uri" locationName:"ElasticsearchVersion" type:"string" required:"true"`
|
||||
|
||||
// Set this value to limit the number of results returned. Value provided must
|
||||
// be greater than 30 else it wont be honored.
|
||||
MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"`
|
||||
|
||||
// NextToken should be sent in case if earlier API call produced result containing
|
||||
// NextToken. It is used for pagination.
|
||||
NextToken *string `location:"querystring" locationName:"nextToken" type:"string"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s ListElasticsearchInstanceTypesInput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s ListElasticsearchInstanceTypesInput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// Validate inspects the fields of the type to determine if they are valid.
|
||||
func (s *ListElasticsearchInstanceTypesInput) Validate() error {
|
||||
invalidParams := request.ErrInvalidParams{Context: "ListElasticsearchInstanceTypesInput"}
|
||||
if s.DomainName != nil && len(*s.DomainName) < 3 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("DomainName", 3))
|
||||
}
|
||||
if s.ElasticsearchVersion == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("ElasticsearchVersion"))
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetDomainName sets the DomainName field's value.
|
||||
func (s *ListElasticsearchInstanceTypesInput) SetDomainName(v string) *ListElasticsearchInstanceTypesInput {
|
||||
s.DomainName = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetElasticsearchVersion sets the ElasticsearchVersion field's value.
|
||||
func (s *ListElasticsearchInstanceTypesInput) SetElasticsearchVersion(v string) *ListElasticsearchInstanceTypesInput {
|
||||
s.ElasticsearchVersion = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetMaxResults sets the MaxResults field's value.
|
||||
func (s *ListElasticsearchInstanceTypesInput) SetMaxResults(v int64) *ListElasticsearchInstanceTypesInput {
|
||||
s.MaxResults = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetNextToken sets the NextToken field's value.
|
||||
func (s *ListElasticsearchInstanceTypesInput) SetNextToken(v string) *ListElasticsearchInstanceTypesInput {
|
||||
s.NextToken = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Container for the parameters returned by ListElasticsearchInstanceTypes operation.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypesResponse
|
||||
type ListElasticsearchInstanceTypesOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// List of instance types supported by Amazon Elasticsearch service for given
|
||||
// ElasticsearchVersion
|
||||
ElasticsearchInstanceTypes []*string `type:"list"`
|
||||
|
||||
// In case if there are more results available NextToken would be present, make
|
||||
// further request to the same API with received NextToken to paginate remaining
|
||||
// results.
|
||||
NextToken *string `type:"string"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s ListElasticsearchInstanceTypesOutput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s ListElasticsearchInstanceTypesOutput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetElasticsearchInstanceTypes sets the ElasticsearchInstanceTypes field's value.
|
||||
func (s *ListElasticsearchInstanceTypesOutput) SetElasticsearchInstanceTypes(v []*string) *ListElasticsearchInstanceTypesOutput {
|
||||
s.ElasticsearchInstanceTypes = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetNextToken sets the NextToken field's value.
|
||||
func (s *ListElasticsearchInstanceTypesOutput) SetNextToken(v string) *ListElasticsearchInstanceTypesOutput {
|
||||
s.NextToken = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Container for the parameters to the ListElasticsearchVersions operation.
|
||||
// Use MaxResults to control the maximum number of results to retrieve in a
|
||||
// single call.
|
||||
//
|
||||
// Use NextToken in response to retrieve more results. If the received response
|
||||
// does not contain a NextToken, then there are no more results to retrieve.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersionsRequest
|
||||
type ListElasticsearchVersionsInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// Set this value to limit the number of results returned. Value provided must
|
||||
// be greater than 10 else it wont be honored.
|
||||
MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"`
|
||||
|
||||
// Paginated APIs accepts NextToken input to returns next page results and provides
|
||||
// a NextToken output in the response which can be used by the client to retrieve
|
||||
// more results.
|
||||
NextToken *string `location:"querystring" locationName:"nextToken" type:"string"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s ListElasticsearchVersionsInput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s ListElasticsearchVersionsInput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetMaxResults sets the MaxResults field's value.
|
||||
func (s *ListElasticsearchVersionsInput) SetMaxResults(v int64) *ListElasticsearchVersionsInput {
|
||||
s.MaxResults = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetNextToken sets the NextToken field's value.
|
||||
func (s *ListElasticsearchVersionsInput) SetNextToken(v string) *ListElasticsearchVersionsInput {
|
||||
s.NextToken = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Container for the parameters for response received from ListElasticsearchVersions
|
||||
// operation.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersionsResponse
|
||||
type ListElasticsearchVersionsOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// List of supported elastic search versions.
|
||||
ElasticsearchVersions []*string `type:"list"`
|
||||
|
||||
// Paginated APIs accepts NextToken input to returns next page results and provides
|
||||
// a NextToken output in the response which can be used by the client to retrieve
|
||||
// more results.
|
||||
NextToken *string `type:"string"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s ListElasticsearchVersionsOutput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s ListElasticsearchVersionsOutput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetElasticsearchVersions sets the ElasticsearchVersions field's value.
|
||||
func (s *ListElasticsearchVersionsOutput) SetElasticsearchVersions(v []*string) *ListElasticsearchVersionsOutput {
|
||||
s.ElasticsearchVersions = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetNextToken sets the NextToken field's value.
|
||||
func (s *ListElasticsearchVersionsOutput) SetNextToken(v string) *ListElasticsearchVersionsOutput {
|
||||
s.NextToken = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Container for the parameters to the ListTags operation. Specify the ARN for
|
||||
// the Elasticsearch domain to which the tags are attached that you want to
|
||||
// view are attached.
|
||||
|
@ -2210,6 +2953,100 @@ func (s *SnapshotOptionsStatus) SetStatus(v *OptionStatus) *SnapshotOptionsStatu
|
|||
return s
|
||||
}
|
||||
|
||||
// StorageTypes represents the list of storage related types and their attributes
|
||||
// that are available for given InstanceType.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/StorageType
|
||||
type StorageType struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// SubType of the given storage type. List of available sub-storage options:
|
||||
// For "instance" storageType we wont have any storageSubType, in case of "ebs"
|
||||
// storageType we will have following valid storageSubTypes standard
|
||||
// gp2
|
||||
// io1
|
||||
// Refer VolumeType for more information regarding above EBS storage options.
|
||||
StorageSubTypeName *string `type:"string"`
|
||||
|
||||
// List of limits that are applicable for given storage type.
|
||||
StorageTypeLimits []*StorageTypeLimit `type:"list"`
|
||||
|
||||
// Type of the storage. List of available storage options: instance
|
||||
// Inbuilt storage available for the given Instance ebs
|
||||
// Elastic block storage that would be attached to the given Instance
|
||||
StorageTypeName *string `type:"string"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s StorageType) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s StorageType) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetStorageSubTypeName sets the StorageSubTypeName field's value.
|
||||
func (s *StorageType) SetStorageSubTypeName(v string) *StorageType {
|
||||
s.StorageSubTypeName = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetStorageTypeLimits sets the StorageTypeLimits field's value.
|
||||
func (s *StorageType) SetStorageTypeLimits(v []*StorageTypeLimit) *StorageType {
|
||||
s.StorageTypeLimits = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetStorageTypeName sets the StorageTypeName field's value.
|
||||
func (s *StorageType) SetStorageTypeName(v string) *StorageType {
|
||||
s.StorageTypeName = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Limits that are applicable for given storage type.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/StorageTypeLimit
|
||||
type StorageTypeLimit struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// Name of storage limits that are applicable for given storage type. If StorageType
|
||||
// is ebs, following storage options are applicable MinimumVolumeSize
|
||||
// Minimum amount of volume size that is applicable for given storage type.It
|
||||
// can be empty if it is not applicable. MaximumVolumeSize
|
||||
// Maximum amount of volume size that is applicable for given storage type.It
|
||||
// can be empty if it is not applicable. MaximumIops
|
||||
// Maximum amount of Iops that is applicable for given storage type.It can
|
||||
// be empty if it is not applicable. MinimumIops
|
||||
// Minimum amount of Iops that is applicable for given storage type.It can
|
||||
// be empty if it is not applicable.
|
||||
LimitName *string `type:"string"`
|
||||
|
||||
// Values for the StorageTypeLimit$LimitName .
|
||||
LimitValues []*string `type:"list"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s StorageTypeLimit) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s StorageTypeLimit) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetLimitName sets the LimitName field's value.
|
||||
func (s *StorageTypeLimit) SetLimitName(v string) *StorageTypeLimit {
|
||||
s.LimitName = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetLimitValues sets the LimitValues field's value.
|
||||
func (s *StorageTypeLimit) SetLimitValues(v []*string) *StorageTypeLimit {
|
||||
s.LimitValues = v
|
||||
return s
|
||||
}
|
||||
|
||||
// Specifies a key value pair for a resource tag.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/Tag
|
||||
type Tag struct {
|
||||
|
@ -2449,6 +3286,51 @@ const (
|
|||
|
||||
// ESPartitionInstanceTypeI22xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeI22xlargeElasticsearch = "i2.2xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeD2XlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeD2XlargeElasticsearch = "d2.xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeD22xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeD22xlargeElasticsearch = "d2.2xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeD24xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeD24xlargeElasticsearch = "d2.4xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeD28xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeD28xlargeElasticsearch = "d2.8xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeC4LargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeC4LargeElasticsearch = "c4.large.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeC4XlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeC4XlargeElasticsearch = "c4.xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeC42xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeC42xlargeElasticsearch = "c4.2xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeC44xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeC44xlargeElasticsearch = "c4.4xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeC48xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeC48xlargeElasticsearch = "c4.8xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeR4LargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeR4LargeElasticsearch = "r4.large.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeR4XlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeR4XlargeElasticsearch = "r4.xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeR42xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeR42xlargeElasticsearch = "r4.2xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeR44xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeR44xlargeElasticsearch = "r4.4xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeR48xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeR48xlargeElasticsearch = "r4.8xlarge.elasticsearch"
|
||||
|
||||
// ESPartitionInstanceTypeR416xlargeElasticsearch is a ESPartitionInstanceType enum value
|
||||
ESPartitionInstanceTypeR416xlargeElasticsearch = "r4.16xlarge.elasticsearch"
|
||||
)
|
||||
|
||||
// The state of a requested change. One of the following:
|
||||
|
|
|
@ -10398,6 +10398,12 @@ func (c *IAM) UploadServerCertificateRequest(input *UploadServerCertificateInput
|
|||
// entity includes a public key certificate, a private key, and an optional
|
||||
// certificate chain, which should all be PEM-encoded.
|
||||
//
|
||||
// We recommend that you use AWS Certificate Manager (https://aws.amazon.com/certificate-manager/)
|
||||
// to provision, manage, and deploy your server certificates. With ACM you can
|
||||
// request a certificate, deploy it to AWS resources, and let ACM handle certificate
|
||||
// renewals for you. Certificates provided by ACM are free. For more information
|
||||
// about using ACM, see the AWS Certificate Manager User Guide (http://docs.aws.amazon.com/acm/latest/userguide/).
|
||||
//
|
||||
// For more information about working with server certificates, including a
|
||||
// list of AWS services that can use the server certificates that you manage
|
||||
// with IAM, go to Working with Server Certificates (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html)
|
||||
|
@ -14604,6 +14610,11 @@ type EvaluationResult struct {
|
|||
// call GetContextKeysForCustomPolicy or GetContextKeysForPrincipalPolicy.
|
||||
MissingContextValues []*string `type:"list"`
|
||||
|
||||
// A structure that details how AWS Organizations and its service control policies
|
||||
// affect the results of the simulation. Only applies if the simulated user's
|
||||
// account is part of an organization.
|
||||
OrganizationsDecisionDetail *OrganizationsDecisionDetail `type:"structure"`
|
||||
|
||||
// The individual results of the simulation of the API action specified in EvalActionName
|
||||
// on each resource.
|
||||
ResourceSpecificResults []*ResourceSpecificResult `type:"list"`
|
||||
|
@ -14655,6 +14666,12 @@ func (s *EvaluationResult) SetMissingContextValues(v []*string) *EvaluationResul
|
|||
return s
|
||||
}
|
||||
|
||||
// SetOrganizationsDecisionDetail sets the OrganizationsDecisionDetail field's value.
|
||||
func (s *EvaluationResult) SetOrganizationsDecisionDetail(v *OrganizationsDecisionDetail) *EvaluationResult {
|
||||
s.OrganizationsDecisionDetail = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetResourceSpecificResults sets the ResourceSpecificResults field's value.
|
||||
func (s *EvaluationResult) SetResourceSpecificResults(v []*ResourceSpecificResult) *EvaluationResult {
|
||||
s.ResourceSpecificResults = v
|
||||
|
@ -20226,6 +20243,32 @@ func (s *OpenIDConnectProviderListEntry) SetArn(v string) *OpenIDConnectProvider
|
|||
return s
|
||||
}
|
||||
|
||||
// Contains information about AWS Organizations's affect on a policy simulation.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/iam-2010-05-08/OrganizationsDecisionDetail
|
||||
type OrganizationsDecisionDetail struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// Specifies whether the simulated action is allowed by the AWS Organizations
|
||||
// service control policies that impact the simulated user's account.
|
||||
AllowedByOrganizations *bool `type:"boolean"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s OrganizationsDecisionDetail) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s OrganizationsDecisionDetail) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetAllowedByOrganizations sets the AllowedByOrganizations field's value.
|
||||
func (s *OrganizationsDecisionDetail) SetAllowedByOrganizations(v bool) *OrganizationsDecisionDetail {
|
||||
s.AllowedByOrganizations = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Contains information about the account password policy.
|
||||
//
|
||||
// This data type is used as a response element in the GetAccountPasswordPolicy
|
||||
|
|
|
@ -165,6 +165,8 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet
|
|||
//
|
||||
// /2013-04-01/hostedzone/Amazon Route 53 hosted Zone ID/rrset resource.
|
||||
//
|
||||
// Change Batches and Transactional Changes
|
||||
//
|
||||
// The request body must include a document with a ChangeResourceRecordSetsRequest
|
||||
// element. The request body contains a list of change items, known as a change
|
||||
// batch. Change batches are considered transactional changes. When using the
|
||||
|
@ -185,6 +187,8 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet
|
|||
// the same change batch more than once, Amazon Route 53 returns an InvalidChangeBatch
|
||||
// error.
|
||||
//
|
||||
// Traffic Flow
|
||||
//
|
||||
// To create resource record sets for complex routing configurations, use either
|
||||
// the traffic flow visual editor in the Amazon Route 53 console or the API
|
||||
// actions for traffic policies and traffic policy instances. Save the configuration
|
||||
|
@ -195,6 +199,8 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet
|
|||
// see Using Traffic Flow to Route DNS Traffic (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/traffic-flow.html)
|
||||
// in the Amazon Route 53 Developer Guide.
|
||||
//
|
||||
// Create, Delete, and Upsert
|
||||
//
|
||||
// Use ChangeResourceRecordsSetsRequest to perform the following actions:
|
||||
//
|
||||
// * CREATE: Creates a resource record set that has the specified values.
|
||||
|
@ -206,47 +212,28 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet
|
|||
// it. If a resource set does exist, Amazon Route 53 updates it with the
|
||||
// values in the request.
|
||||
//
|
||||
// The values that you need to include in the request depend on the type of
|
||||
// resource record set that you're creating, deleting, or updating:
|
||||
// Syntaxes for Creating, Updating, and Deleting Resource Record Sets
|
||||
//
|
||||
// Basic resource record sets (excluding alias, failover, geolocation, latency,
|
||||
// and weighted resource record sets)
|
||||
// The syntax for a request depends on the type of resource record set that
|
||||
// you want to create, delete, or update, such as weighted, alias, or failover.
|
||||
// The XML elements in your request must appear in the order listed in the syntax.
|
||||
//
|
||||
// * Name
|
||||
// For an example for each type of resource record set, see "Examples."
|
||||
//
|
||||
// * Type
|
||||
// Don't refer to the syntax in the "Parameter Syntax" section, which includes
|
||||
// all of the elements for every kind of resource record set that you can create,
|
||||
// delete, or update by using ChangeResourceRecordSets.
|
||||
//
|
||||
// * TTL
|
||||
//
|
||||
// Failover, geolocation, latency, or weighted resource record sets (excluding
|
||||
// alias resource record sets)
|
||||
//
|
||||
// * Name
|
||||
//
|
||||
// * Type
|
||||
//
|
||||
// * TTL
|
||||
//
|
||||
// * SetIdentifier
|
||||
//
|
||||
// Alias resource record sets (including failover alias, geolocation alias,
|
||||
// latency alias, and weighted alias resource record sets)
|
||||
//
|
||||
// * Name
|
||||
//
|
||||
// * Type
|
||||
//
|
||||
// * AliasTarget (includes DNSName, EvaluateTargetHealth, and HostedZoneId)
|
||||
//
|
||||
// * SetIdentifier (for failover, geolocation, latency, and weighted resource
|
||||
// record sets)
|
||||
// Change Propagation to Amazon Route 53 DNS Servers
|
||||
//
|
||||
// When you submit a ChangeResourceRecordSets request, Amazon Route 53 propagates
|
||||
// your changes to all of the Amazon Route 53 authoritative DNS servers. While
|
||||
// your changes are propagating, GetChange returns a status of PENDING. When
|
||||
// propagation is complete, GetChange returns a status of INSYNC. Changes generally
|
||||
// propagate to all Amazon Route 53 name servers in a few minutes. In rare circumstances,
|
||||
// propagation can take up to 30 minutes. For more information, see GetChange
|
||||
// propagation can take up to 30 minutes. For more information, see GetChange.
|
||||
//
|
||||
// Limits on ChangeResourceRecordSets Requests
|
||||
//
|
||||
// For information about the limits on a ChangeResourceRecordSets request, see
|
||||
// Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
|
||||
|
@ -365,6 +352,7 @@ func (c *Route53) ChangeTagsForResourceRequest(input *ChangeTagsForResourceInput
|
|||
// duration, before you try the request again.
|
||||
//
|
||||
// * ErrCodeThrottlingException "ThrottlingException"
|
||||
// The limit on the number of requests per second was exceeded.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeTagsForResource
|
||||
func (c *Route53) ChangeTagsForResource(input *ChangeTagsForResourceInput) (*ChangeTagsForResourceOutput, error) {
|
||||
|
@ -427,7 +415,7 @@ func (c *Route53) CreateHealthCheckRequest(input *CreateHealthCheckInput) (req *
|
|||
// set. For information about adding health checks to resource record sets,
|
||||
// see ResourceRecordSet$HealthCheckId in ChangeResourceRecordSets.
|
||||
//
|
||||
// If you are registering EC2 instances with an Elastic Load Balancing (ELB)
|
||||
// If you're registering EC2 instances with an Elastic Load Balancing (ELB)
|
||||
// load balancer, do not create Amazon Route 53 health checks for the EC2 instances.
|
||||
// When you register an EC2 instance with a load balancer, you configure settings
|
||||
// for an ELB health check, which performs a similar function to an Amazon Route
|
||||
|
@ -465,10 +453,9 @@ func (c *Route53) CreateHealthCheckRequest(input *CreateHealthCheckInput) (req *
|
|||
// with the AWS Support Center.
|
||||
//
|
||||
// * ErrCodeHealthCheckAlreadyExists "HealthCheckAlreadyExists"
|
||||
// The health check you're attempting to create already exists.
|
||||
//
|
||||
// Amazon Route 53 returns this error when a health check has already been created
|
||||
// with the specified value for CallerReference.
|
||||
// The health check you're attempting to create already exists. Amazon Route
|
||||
// 53 returns this error when a health check has already been created with the
|
||||
// specified value for CallerReference.
|
||||
//
|
||||
// * ErrCodeInvalidInput "InvalidInput"
|
||||
// The input is not valid.
|
||||
|
@ -578,8 +565,8 @@ func (c *Route53) CreateHostedZoneRequest(input *CreateHostedZoneInput) (req *re
|
|||
// The specified domain name is not valid.
|
||||
//
|
||||
// * ErrCodeHostedZoneAlreadyExists "HostedZoneAlreadyExists"
|
||||
// The hosted zone you are trying to create already exists. Amazon Route 53
|
||||
// returns this error when a hosted zone has already been created with the specified
|
||||
// The hosted zone you're trying to create already exists. Amazon Route 53 returns
|
||||
// this error when a hosted zone has already been created with the specified
|
||||
// CallerReference.
|
||||
//
|
||||
// * ErrCodeTooManyHostedZones "TooManyHostedZones"
|
||||
|
@ -698,7 +685,7 @@ func (c *Route53) CreateReusableDelegationSetRequest(input *CreateReusableDelega
|
|||
// The specified HostedZone can't be found.
|
||||
//
|
||||
// * ErrCodeInvalidArgument "InvalidArgument"
|
||||
// Parameter name and problem.
|
||||
// Parameter name is invalid.
|
||||
//
|
||||
// * ErrCodeInvalidInput "InvalidInput"
|
||||
// The input is not valid.
|
||||
|
@ -1049,6 +1036,10 @@ func (c *Route53) CreateVPCAssociationAuthorizationRequest(input *CreateVPCAssoc
|
|||
// API operation CreateVPCAssociationAuthorization for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * ErrCodeConcurrentModification "ConcurrentModification"
|
||||
// Another user submitted a request to update the object at the same time that
|
||||
// you did. Retry the request.
|
||||
//
|
||||
// * ErrCodeTooManyVPCAssociationAuthorizations "TooManyVPCAssociationAuthorizations"
|
||||
// You've created the maximum number of authorizations that can be created for
|
||||
// the specified hosted zone. To authorize another VPC to be associated with
|
||||
|
@ -1556,6 +1547,10 @@ func (c *Route53) DeleteVPCAssociationAuthorizationRequest(input *DeleteVPCAssoc
|
|||
// API operation DeleteVPCAssociationAuthorization for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * ErrCodeConcurrentModification "ConcurrentModification"
|
||||
// Another user submitted a request to update the object at the same time that
|
||||
// you did. Retry the request.
|
||||
//
|
||||
// * ErrCodeVPCAssociationAuthorizationNotFound "VPCAssociationAuthorizationNotFound"
|
||||
// The VPC that you specified is not authorized to be associated with the hosted
|
||||
// zone.
|
||||
|
@ -1788,11 +1783,10 @@ func (c *Route53) GetCheckerIpRangesRequest(input *GetCheckerIpRangesInput) (req
|
|||
|
||||
// GetCheckerIpRanges API operation for Amazon Route 53.
|
||||
//
|
||||
// Retrieves a list of the IP ranges used by Amazon Route 53 health checkers
|
||||
// to check the health of your resources. Send a GET request to the /Amazon
|
||||
// Route 53 API version/checkeripranges resource. Use these IP addresses to
|
||||
// configure router and firewall rules to allow health checkers to check the
|
||||
// health of your resources.
|
||||
// GetCheckerIpRanges still works, but we recommend that you download ip-ranges.json,
|
||||
// which includes IP address ranges for all AWS services. For more information,
|
||||
// see IP Address Ranges of Amazon Route 53 Servers (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/route-53-ip-addresses.html)
|
||||
// in the Amazon Route 53 Developer Guide.
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
|
@ -1944,8 +1938,8 @@ func (c *Route53) GetHealthCheckRequest(input *GetHealthCheckInput) (req *reques
|
|||
// The input is not valid.
|
||||
//
|
||||
// * ErrCodeIncompatibleVersion "IncompatibleVersion"
|
||||
// The resource you are trying to access is unsupported on this Amazon Route
|
||||
// 53 endpoint. Please consider using a newer endpoint or a tool that does so.
|
||||
// The resource you're trying to access is unsupported on this Amazon Route
|
||||
// 53 endpoint.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheck
|
||||
func (c *Route53) GetHealthCheck(input *GetHealthCheckInput) (*GetHealthCheckOutput, error) {
|
||||
|
@ -2724,8 +2718,8 @@ func (c *Route53) ListHealthChecksRequest(input *ListHealthChecksInput) (req *re
|
|||
// The input is not valid.
|
||||
//
|
||||
// * ErrCodeIncompatibleVersion "IncompatibleVersion"
|
||||
// The resource you are trying to access is unsupported on this Amazon Route
|
||||
// 53 endpoint. Please consider using a newer endpoint or a tool that does so.
|
||||
// The resource you're trying to access is unsupported on this Amazon Route
|
||||
// 53 endpoint.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHealthChecks
|
||||
func (c *Route53) ListHealthChecks(input *ListHealthChecksInput) (*ListHealthChecksOutput, error) {
|
||||
|
@ -3292,6 +3286,7 @@ func (c *Route53) ListTagsForResourceRequest(input *ListTagsForResourceInput) (r
|
|||
// duration, before you try the request again.
|
||||
//
|
||||
// * ErrCodeThrottlingException "ThrottlingException"
|
||||
// The limit on the number of requests per second was exceeded.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResource
|
||||
func (c *Route53) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) {
|
||||
|
@ -3377,6 +3372,7 @@ func (c *Route53) ListTagsForResourcesRequest(input *ListTagsForResourcesInput)
|
|||
// duration, before you try the request again.
|
||||
//
|
||||
// * ErrCodeThrottlingException "ThrottlingException"
|
||||
// The limit on the number of requests per second was exceeded.
|
||||
//
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResources
|
||||
func (c *Route53) ListTagsForResources(input *ListTagsForResourcesInput) (*ListTagsForResourcesOutput, error) {
|
||||
|
@ -4418,7 +4414,8 @@ type AlarmIdentifier struct {
|
|||
// healthy.
|
||||
//
|
||||
// For the current list of CloudWatch regions, see Amazon CloudWatch (http://docs.aws.amazon.com/general/latest/gr/rande.html#cw_region)
|
||||
// in AWS Regions and Endpoints in the Amazon Web Services General Reference.
|
||||
// in the AWS Regions and Endpoints chapter of the Amazon Web Services General
|
||||
// Reference.
|
||||
//
|
||||
// Region is a required field
|
||||
Region *string `min:"1" type:"string" required:"true" enum:"CloudWatchRegion"`
|
||||
|
@ -4470,7 +4467,7 @@ func (s *AlarmIdentifier) SetRegion(v string) *AlarmIdentifier {
|
|||
|
||||
// Alias resource record sets only: Information about the CloudFront distribution,
|
||||
// Elastic Beanstalk environment, ELB load balancer, Amazon S3 bucket, or Amazon
|
||||
// Route 53 resource record set that you're redirecting queries to. The Elastic
|
||||
// Route 53 resource record set that you're redirecting queries to. An Elastic
|
||||
// Beanstalk environment must have a regionalized subdomain.
|
||||
//
|
||||
// When creating resource record sets for a private hosted zone, note the following:
|
||||
|
@ -4490,70 +4487,62 @@ type AliasTarget struct {
|
|||
// Alias resource record sets only: The value that you specify depends on where
|
||||
// you want to route queries:
|
||||
//
|
||||
// * A CloudFront distribution: Specify the domain name that CloudFront assigned
|
||||
// when you created your distribution.
|
||||
// CloudFront distributionSpecify the domain name that CloudFront assigned when
|
||||
// you created your distribution.
|
||||
//
|
||||
// Your CloudFront distribution must include an alternate domain name that matches
|
||||
// the name of the resource record set. For example, if the name of the resource
|
||||
// record set is acme.example.com, your CloudFront distribution must include
|
||||
// acme.example.com as one of the alternate domain names. For more information,
|
||||
// see Using Alternate Domain Names (CNAMEs) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html)
|
||||
// in the Amazon CloudFront Developer Guide.
|
||||
// the name of the resource record set. For example, if the name of the resource
|
||||
// record set is acme.example.com, your CloudFront distribution must include
|
||||
// acme.example.com as one of the alternate domain names. For more information,
|
||||
// see Using Alternate Domain Names (CNAMEs) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html)
|
||||
// in the Amazon CloudFront Developer Guide.
|
||||
//
|
||||
// * Elastic Beanstalk environment: Specify the CNAME attribute for the environment.
|
||||
// (The environment must have a regionalized domain name.) You can use the
|
||||
// following methods to get the value of the CNAME attribute:
|
||||
// Elastic Beanstalk environmentSpecify the CNAME attribute for the environment.
|
||||
// (The environment must have a regionalized domain name.) You can use the following
|
||||
// methods to get the value of the CNAME attribute:
|
||||
//
|
||||
// AWS Management Console: For information about how to get the value by using
|
||||
// the console, see Using Custom Domains with AWS Elastic Beanstalk (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html)
|
||||
// in the AWS Elastic Beanstalk Developer Guide.
|
||||
// the console, see Using Custom Domains with AWS Elastic Beanstalk (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html)
|
||||
// in the AWS Elastic Beanstalk Developer Guide.
|
||||
//
|
||||
// Elastic Beanstalk API: Use the DescribeEnvironments action to get the value
|
||||
// of the CNAME attribute. For more information, see DescribeEnvironments
|
||||
// (http://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_DescribeEnvironments.html)
|
||||
// in the AWS Elastic Beanstalk API Reference.
|
||||
// of the CNAME attribute. For more information, see DescribeEnvironments (http://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_DescribeEnvironments.html)
|
||||
// in the AWS Elastic Beanstalk API Reference.
|
||||
//
|
||||
// AWS CLI: Use the describe-environments command to get the value of the CNAME
|
||||
// attribute. For more information, see describe-environments (http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/describe-environments.html)
|
||||
// in the AWS Command Line Interface Reference.
|
||||
// attribute. For more information, see describe-environments (http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/describe-environments.html)
|
||||
// in the AWS Command Line Interface Reference.
|
||||
//
|
||||
// * An ELB load balancer: Specify the DNS name that is associated with the
|
||||
// load balancer. Get the DNS name by using the AWS Management Console, the
|
||||
// ELB API, or the AWS CLI. Use the same method to get values for HostedZoneId
|
||||
// and DNSName. If you get one value from the console and the other value
|
||||
// from the API or the CLI, creating the resource record set will fail.
|
||||
// ELB load balancerSpecify the DNS name that is associated with the load balancer.
|
||||
// Get the DNS name by using the AWS Management Console, the ELB API, or the
|
||||
// AWS CLI.
|
||||
//
|
||||
// AWS Management Console: Go to the EC2 page, click Load Balancers in the navigation
|
||||
// pane, choose the load balancer, choose the Description tab, and get the
|
||||
// value of the DNS name field. (If you're routing traffic to a Classic Load
|
||||
// Balancer, get the value that begins with dualstack.) Use the same process
|
||||
// to get the value of the Hosted zone field. See AliasTarget$HostedZoneId.
|
||||
// AWS Management Console: Go to the EC2 page, choose Load Balancers in the
|
||||
// navigation pane, choose the load balancer, choose the Description tab, and
|
||||
// get the value of the DNS name field. (If you're routing traffic to a Classic
|
||||
// Load Balancer, get the value that begins with dualstack.)
|
||||
//
|
||||
// Elastic Load Balancing API: Use DescribeLoadBalancers to get the value of
|
||||
// DNSName and CanonicalHostedZoneNameId. (You specify the value of CanonicalHostedZoneNameId
|
||||
// for AliasTarget$HostedZoneId.) For more information, see the applicable
|
||||
// guide:
|
||||
// DNSName. For more information, see the applicable guide:
|
||||
//
|
||||
// Classic Load Balancer: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html)
|
||||
//
|
||||
// Application Load Balancer: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html)
|
||||
//
|
||||
// AWS CLI: Use describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html)
|
||||
// to get the value of DNSName and CanonicalHostedZoneNameId. (You specify
|
||||
// the value of CanonicalHostedZoneNameId for AliasTarget$HostedZoneId.)
|
||||
// to get the value of DNSName.
|
||||
//
|
||||
// * An Amazon S3 bucket that is configured as a static website: Specify
|
||||
// the domain name of the Amazon S3 website endpoint in which you created
|
||||
// the bucket, for example, s3-website-us-east-1.amazonaws.com. For more
|
||||
// information about valid values, see the table Amazon Simple Storage Service
|
||||
// (S3) Website Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region)
|
||||
// in the Amazon Web Services General Reference. For more information about
|
||||
// using S3 buckets for websites, see Getting Started with Amazon Route 53
|
||||
// (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started.html)
|
||||
// in the Amazon Route 53 Developer Guide.
|
||||
// Amazon S3 bucket that is configured as a static websiteSpecify the domain
|
||||
// name of the Amazon S3 website endpoint in which you created the bucket, for
|
||||
// example, s3-website-us-east-2.amazonaws.com. For more information about valid
|
||||
// values, see the table Amazon Simple Storage Service (S3) Website Endpoints
|
||||
// (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) in the
|
||||
// Amazon Web Services General Reference. For more information about using S3
|
||||
// buckets for websites, see Getting Started with Amazon Route 53 (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started.html)
|
||||
// in the Amazon Route 53 Developer Guide.
|
||||
//
|
||||
// * Another Amazon Route 53 resource record set: Specify the value of the
|
||||
// Name element for a resource record set in the current hosted zone.
|
||||
// Another Amazon Route 53 resource record setSpecify the value of the Name
|
||||
// element for a resource record set in the current hosted zone.
|
||||
//
|
||||
// DNSName is a required field
|
||||
DNSName *string `type:"string" required:"true"`
|
||||
|
@ -4638,10 +4627,10 @@ type AliasTarget struct {
|
|||
// EvaluateTargetHealth is a required field
|
||||
EvaluateTargetHealth *bool `type:"boolean" required:"true"`
|
||||
|
||||
// Alias resource records sets only: The value used depends on where the queries
|
||||
// are routed:
|
||||
// Alias resource records sets only: The value used depends on where you want
|
||||
// to route traffic:
|
||||
//
|
||||
// A CloudFront distributionSpecify Z2FDTNDATAQYW2.
|
||||
// CloudFront distributionSpecify Z2FDTNDATAQYW2.
|
||||
//
|
||||
// Alias resource record sets for CloudFront can't be created in a private zone.
|
||||
//
|
||||
|
@ -4649,33 +4638,37 @@ type AliasTarget struct {
|
|||
// which you created the environment. The environment must have a regionalized
|
||||
// subdomain. For a list of regions and the corresponding hosted zone IDs, see
|
||||
// AWS Elastic Beanstalk (http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region)
|
||||
// in the Regions and Endpoints chapter of the Amazon Web Services General Reference.
|
||||
// in the "AWS Regions and Endpoints" chapter of the Amazon Web Services General
|
||||
// Reference.
|
||||
//
|
||||
// ELB load balancerSpecify the value of the hosted zone ID for the load balancer.
|
||||
// Use the following methods to get the hosted zone ID:
|
||||
//
|
||||
// Elastic Load Balancing (http://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region)
|
||||
// table in the "AWS Regions and Endpoints" chapter of the Amazon Web Services
|
||||
// General Reference: Use the value in the "Amazon Route 53 Hosted Zone ID"
|
||||
// column that corresponds with the region that you created your load balancer
|
||||
// in.
|
||||
//
|
||||
// AWS Management Console: Go to the Amazon EC2 page, click Load Balancers in
|
||||
// the navigation pane, select the load balancer, and get the value of the Hosted
|
||||
// zone field on the Description tab. Use the same process to get the value
|
||||
// of DNS name. (You specify the value of DNS name for AliasTarget$DNSName.)
|
||||
// zone field on the Description tab.
|
||||
//
|
||||
// Elastic Load Balancing API: Use DescribeLoadBalancers to get the value of
|
||||
// CanonicalHostedZoneNameId and DNSName. (You specify the value of DNSName
|
||||
// for AliasTarget$DNSName.) For more information, see the applicable guide:
|
||||
// CanonicalHostedZoneNameId. For more information, see the applicable guide:
|
||||
//
|
||||
// Classic Load Balancer: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html)
|
||||
//
|
||||
// Application Load Balancer: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html)
|
||||
//
|
||||
// AWS CLI: Use describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html)
|
||||
// to get the value of CanonicalHostedZoneNameID and DNSName. (You specify the
|
||||
// value of DNSName for AliasTarget$DNSName.)
|
||||
// to get the value of CanonicalHostedZoneNameID.
|
||||
//
|
||||
// An Amazon S3 bucket configured as a static websiteSpecify the hosted zone
|
||||
// ID for the region that you created the bucket in. For more information about
|
||||
// valid values, see the table Amazon Simple Storage Service Website Endpoints
|
||||
// (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) in the
|
||||
// Amazon Web Services General Reference.
|
||||
// valid values, see the Amazon Simple Storage Service Website Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region)
|
||||
// table in the "AWS Regions and Endpoints" chapter of the Amazon Web Services
|
||||
// General Reference.
|
||||
//
|
||||
// Another Amazon Route 53 resource record set in your hosted zoneSpecify the
|
||||
// hosted zone ID of your hosted zone. (An alias resource record set can't reference
|
||||
|
@ -5280,7 +5273,7 @@ type CloudWatchAlarmConfiguration struct {
|
|||
|
||||
// For the metric that the CloudWatch alarm is associated with, a complex type
|
||||
// that contains information about the dimensions for the metric.For information,
|
||||
// see Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference ( http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html)
|
||||
// see Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html)
|
||||
// in the Amazon CloudWatch User Guide.
|
||||
Dimensions []*Dimension `locationNameList:"Dimension" type:"list"`
|
||||
|
||||
|
@ -7027,7 +7020,6 @@ func (s *GetChangeOutput) SetChangeInfo(v *ChangeInfo) *GetChangeOutput {
|
|||
return s
|
||||
}
|
||||
|
||||
// Empty request.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetCheckerIpRangesRequest
|
||||
type GetCheckerIpRangesInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
@ -7043,14 +7035,10 @@ func (s GetCheckerIpRangesInput) GoString() string {
|
|||
return s.String()
|
||||
}
|
||||
|
||||
// A complex type that contains the CheckerIpRanges element.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetCheckerIpRangesResponse
|
||||
type GetCheckerIpRangesOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// A complex type that contains sorted list of IP ranges in CIDR format for
|
||||
// Amazon Route 53 health checkers.
|
||||
//
|
||||
// CheckerIpRanges is a required field
|
||||
CheckerIpRanges []*string `type:"list" required:"true"`
|
||||
}
|
||||
|
@ -7388,63 +7376,13 @@ func (s *GetHealthCheckOutput) SetHealthCheck(v *HealthCheck) *GetHealthCheckOut
|
|||
type GetHealthCheckStatusInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// If you want Amazon Route 53 to return this resource record set in response
|
||||
// to a DNS query only when a health check is passing, include the HealthCheckId
|
||||
// element and specify the ID of the applicable health check.
|
||||
// The ID for the health check for which you want the current status. When you
|
||||
// created the health check, CreateHealthCheck returned the ID in the response,
|
||||
// in the HealthCheckId element.
|
||||
//
|
||||
// Amazon Route 53 determines whether a resource record set is healthy by periodically
|
||||
// sending a request to the endpoint that is specified in the health check.
|
||||
// If that endpoint returns an HTTP status code of 2xx or 3xx, the endpoint
|
||||
// is healthy. If the endpoint returns an HTTP status code of 400 or greater,
|
||||
// or if the endpoint doesn't respond for a certain amount of time, Amazon Route
|
||||
// 53 considers the endpoint unhealthy and also considers the resource record
|
||||
// set unhealthy.
|
||||
//
|
||||
// The HealthCheckId element is only useful when Amazon Route 53 is choosing
|
||||
// between two or more resource record sets to respond to a DNS query, and you
|
||||
// want Amazon Route 53 to base the choice in part on the status of a health
|
||||
// check. Configuring health checks only makes sense in the following configurations:
|
||||
//
|
||||
// * You're checking the health of the resource record sets in a weighted,
|
||||
// latency, geolocation, or failover resource record set, and you specify
|
||||
// health check IDs for all of the resource record sets. If the health check
|
||||
// for one resource record set specifies an endpoint that is not healthy,
|
||||
// Amazon Route 53 stops responding to queries using the value for that resource
|
||||
// record set.
|
||||
//
|
||||
// * You set EvaluateTargetHealth to true for the resource record sets in
|
||||
// an alias, weighted alias, latency alias, geolocation alias, or failover
|
||||
// alias resource record set, and you specify health check IDs for all of
|
||||
// the resource record sets that are referenced by the alias resource record
|
||||
// sets. For more information about this configuration, see EvaluateTargetHealth.
|
||||
//
|
||||
// Amazon Route 53 doesn't check the health of the endpoint specified in the
|
||||
// resource record set, for example, the endpoint specified by the IP address
|
||||
// in the Value element. When you add a HealthCheckId element to a resource
|
||||
// record set, Amazon Route 53 checks the health of the endpoint that you
|
||||
// specified in the health check.
|
||||
//
|
||||
// For geolocation resource record sets, if an endpoint is unhealthy, Amazon
|
||||
// Route 53 looks for a resource record set for the larger, associated geographic
|
||||
// region. For example, suppose you have resource record sets for a state in
|
||||
// the United States, for the United States, for North America, and for all
|
||||
// locations. If the endpoint for the state resource record set is unhealthy,
|
||||
// Amazon Route 53 checks the resource record sets for the United States, for
|
||||
// North America, and for all locations (a resource record set for which the
|
||||
// value of CountryCode is *), in that order, until it finds a resource record
|
||||
// set for which the endpoint is healthy.
|
||||
//
|
||||
// If your health checks specify the endpoint only by domain name, we recommend
|
||||
// that you create a separate health check for each endpoint. For example, create
|
||||
// a health check for each HTTP server that is serving content for www.example.com.
|
||||
// For the value of FullyQualifiedDomainName, specify the domain name of the
|
||||
// server (such as us-east-1-www.example.com), not the name of the resource
|
||||
// record sets (example.com).
|
||||
//
|
||||
// In this configuration, if you create a health check for which the value of
|
||||
// FullyQualifiedDomainName matches the name of the resource record sets and
|
||||
// then associate the health check with those resource record sets, health check
|
||||
// results will be unpredictable.
|
||||
// If you want to check the status of a calculated health check, you must use
|
||||
// the Amazon Route 53 console or the CloudWatch console. You can't use GetHealthCheckStatus
|
||||
// to get the status of a calculated health check.
|
||||
//
|
||||
// HealthCheckId is a required field
|
||||
HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"`
|
||||
|
@ -7771,8 +7709,8 @@ func (s *GetTrafficPolicyInput) SetVersion(v int64) *GetTrafficPolicyInput {
|
|||
return s
|
||||
}
|
||||
|
||||
// To retrieve a count of all your traffic policy instances, send a GET request
|
||||
// to the /2013-04-01/trafficpolicyinstancecount resource.
|
||||
// Request to get the number of traffic policy instances that are associated
|
||||
// with the current AWS account.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstanceCountRequest
|
||||
type GetTrafficPolicyInstanceCountInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
@ -8036,6 +7974,9 @@ type HealthCheckConfig struct {
|
|||
// to healthy or vice versa. For more information, see How Amazon Route 53 Determines
|
||||
// Whether an Endpoint Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html)
|
||||
// in the Amazon Route 53 Developer Guide.
|
||||
//
|
||||
// If you don't specify a value for FailureThreshold, the default value is three
|
||||
// health checks.
|
||||
FailureThreshold *int64 `min:"1" type:"integer"`
|
||||
|
||||
// Amazon Route 53 behavior depends on whether you specify a value for IPAddress.
|
||||
|
@ -8083,7 +8024,7 @@ type HealthCheckConfig struct {
|
|||
// we recommend that you create a separate health check for each endpoint. For
|
||||
// example, create a health check for each HTTP server that is serving content
|
||||
// for www.example.com. For the value of FullyQualifiedDomainName, specify the
|
||||
// domain name of the server (such as us-east-1-www.example.com), not the name
|
||||
// domain name of the server (such as us-east-2-www.example.com), not the name
|
||||
// of the resource record sets (www.example.com).
|
||||
//
|
||||
// In this configuration, if you create a health check for which the value of
|
||||
|
@ -8119,6 +8060,16 @@ type HealthCheckConfig struct {
|
|||
// Using an IP address returned by DNS, Amazon Route 53 then checks the health
|
||||
// of the endpoint.
|
||||
//
|
||||
// Use one of the following formats for the value of IPAddress:
|
||||
//
|
||||
// * IPv4 address: four values between 0 and 255, separated by periods (.),
|
||||
// for example, 192.0.2.44.
|
||||
//
|
||||
// * IPv6 address: eight groups of four hexadecimal values, separated by
|
||||
// colons (:), for example, 2001:0db8:85a3:0000:0000:abcd:0001:2345. You
|
||||
// can also shorten IPv6 addresses as described in RFC 5952, for example,
|
||||
// 2001:db8:85a3::abcd:1:2345.
|
||||
//
|
||||
// If the endpoint is an EC2 instance, we recommend that you create an Elastic
|
||||
// IP address, associate it with your EC2 instance, and specify the Elastic
|
||||
// IP address for IPAddress. This ensures that the IP address of your instance
|
||||
|
@ -8171,13 +8122,24 @@ type HealthCheckConfig struct {
|
|||
|
||||
// A complex type that contains one Region element for each region from which
|
||||
// you want Amazon Route 53 health checkers to check the specified endpoint.
|
||||
//
|
||||
// If you don't specify any regions, Amazon Route 53 health checkers automatically
|
||||
// performs checks from all of the regions that are listed under Valid Values.
|
||||
//
|
||||
// If you update a health check to remove a region that has been performing
|
||||
// health checks, Amazon Route 53 will briefly continue to perform checks from
|
||||
// that region to ensure that some health checkers are always checking the endpoint
|
||||
// (for example, if you replace three regions with four different regions).
|
||||
Regions []*string `locationNameList:"Region" min:"1" type:"list"`
|
||||
|
||||
// The number of seconds between the time that Amazon Route 53 gets a response
|
||||
// from your endpoint and the time that it sends the next health-check request.
|
||||
// from your endpoint and the time that it sends the next health check request.
|
||||
// Each Amazon Route 53 health checker makes requests at this interval.
|
||||
//
|
||||
// You can't change the value of RequestInterval after you create a health check.
|
||||
//
|
||||
// If you don't specify a value for RequestInterval, the default value is 30
|
||||
// seconds.
|
||||
RequestInterval *int64 `min:"10" type:"integer"`
|
||||
|
||||
// The path, if any, that you want Amazon Route 53 to request when performing
|
||||
|
@ -10250,8 +10212,8 @@ func (s *ListTrafficPolicyInstancesByPolicyOutput) SetTrafficPolicyInstances(v [
|
|||
return s
|
||||
}
|
||||
|
||||
// A complex type that contains the information about the request to list your
|
||||
// traffic policy instances.
|
||||
// A request to get information about the traffic policy instances that you
|
||||
// created by using the current AWS account.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesRequest
|
||||
type ListTrafficPolicyInstancesInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
@ -10690,7 +10652,7 @@ func (s *ListVPCAssociationAuthorizationsOutput) SetVPCs(v []*VPC) *ListVPCAssoc
|
|||
|
||||
// Information specific to the resource record.
|
||||
//
|
||||
// If you are creating an alias resource record set, omit ResourceRecord.
|
||||
// If you're creating an alias resource record set, omit ResourceRecord.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ResourceRecord
|
||||
type ResourceRecord struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
@ -10704,7 +10666,7 @@ type ResourceRecord struct {
|
|||
// You can specify more than one value for all record types except CNAME and
|
||||
// SOA.
|
||||
//
|
||||
// If you are creating an alias resource record set, omit Value.
|
||||
// If you're creating an alias resource record set, omit Value.
|
||||
//
|
||||
// Value is a required field
|
||||
Value *string `type:"string" required:"true"`
|
||||
|
@ -10746,7 +10708,7 @@ type ResourceRecordSet struct {
|
|||
|
||||
// Alias resource record sets only: Information about the CloudFront distribution,
|
||||
// AWS Elastic Beanstalk environment, ELB load balancer, Amazon S3 bucket, or
|
||||
// Amazon Route 53 resource record set to which you are redirecting queries.
|
||||
// Amazon Route 53 resource record set to which you're redirecting queries.
|
||||
// The AWS Elastic Beanstalk environment must have a regionalized subdomain.
|
||||
//
|
||||
// If you're creating resource records sets for a private hosted zone, note
|
||||
|
@ -10859,26 +10821,26 @@ type ResourceRecordSet struct {
|
|||
// * By determining the current state of a CloudWatch alarm (CloudWatch metric
|
||||
// health checks)
|
||||
//
|
||||
// For information about how Amazon Route 53 determines whether a health check
|
||||
// is healthy, see CreateHealthCheck.
|
||||
// For more information, see How Amazon Route 53 Determines Whether an Endpoint
|
||||
// Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html).
|
||||
//
|
||||
// The HealthCheckId element is only useful when Amazon Route 53 is choosing
|
||||
// between two or more resource record sets to respond to a DNS query, and you
|
||||
// want Amazon Route 53 to base the choice in part on the status of a health
|
||||
// check. Configuring health checks only makes sense in the following configurations:
|
||||
//
|
||||
// * You're checking the health of the resource record sets in a weighted,
|
||||
// latency, geolocation, or failover resource record set, and you specify
|
||||
// health check IDs for all of the resource record sets. If the health check
|
||||
// for one resource record set specifies an endpoint that is not healthy,
|
||||
// Amazon Route 53 stops responding to queries using the value for that resource
|
||||
// record set.
|
||||
// * You're checking the health of the resource record sets in a group of
|
||||
// weighted, latency, geolocation, or failover resource record sets, and
|
||||
// you specify health check IDs for all of the resource record sets. If the
|
||||
// health check for one resource record set specifies an endpoint that is
|
||||
// not healthy, Amazon Route 53 stops responding to queries using the value
|
||||
// for that resource record set.
|
||||
//
|
||||
// * You set EvaluateTargetHealth to true for the resource record sets in
|
||||
// an alias, weighted alias, latency alias, geolocation alias, or failover
|
||||
// alias resource record set, and you specify health check IDs for all of
|
||||
// the resource record sets that are referenced by the alias resource record
|
||||
// sets.
|
||||
// a group of alias, weighted alias, latency alias, geolocation alias, or
|
||||
// failover alias resource record sets, and you specify health check IDs
|
||||
// for all of the resource record sets that are referenced by the alias resource
|
||||
// record sets.
|
||||
//
|
||||
// Amazon Route 53 doesn't check the health of the endpoint specified in the
|
||||
// resource record set, for example, the endpoint specified by the IP address
|
||||
|
@ -10900,7 +10862,7 @@ type ResourceRecordSet struct {
|
|||
// that you create a separate health check for each endpoint. For example, create
|
||||
// a health check for each HTTP server that is serving content for www.example.com.
|
||||
// For the value of FullyQualifiedDomainName, specify the domain name of the
|
||||
// server (such as us-east-1-www.example.com), not the name of the resource
|
||||
// server (such as us-east-2-www.example.com), not the name of the resource
|
||||
// record sets (example.com).
|
||||
//
|
||||
// n this configuration, if you create a health check for which the value of
|
||||
|
@ -10974,10 +10936,9 @@ type ResourceRecordSet struct {
|
|||
// * You can only create one latency resource record set for each Amazon
|
||||
// EC2 Region.
|
||||
//
|
||||
// * You are not required to create latency resource record sets for all
|
||||
// Amazon EC2 Regions. Amazon Route 53 will choose the region with the best
|
||||
// latency from among the regions for which you create latency resource record
|
||||
// sets.
|
||||
// * You aren't required to create latency resource record sets for all Amazon
|
||||
// EC2 Regions. Amazon Route 53 will choose the region with the best latency
|
||||
// from among the regions for which you create latency resource record sets.
|
||||
//
|
||||
// * You can't create non-latency resource record sets that have the same
|
||||
// values for the Name and Type elements as latency resource record sets.
|
||||
|
@ -10985,7 +10946,7 @@ type ResourceRecordSet struct {
|
|||
|
||||
// Information about the resource records to act upon.
|
||||
//
|
||||
// If you are creating an alias resource record set, omit ResourceRecords.
|
||||
// If you're creating an alias resource record set, omit ResourceRecords.
|
||||
ResourceRecords []*ResourceRecord `locationNameList:"ResourceRecord" min:"1" type:"list"`
|
||||
|
||||
// Weighted, Latency, Geo, and Failover resource record sets only: An identifier
|
||||
|
@ -11926,6 +11887,9 @@ type UpdateHealthCheckInput struct {
|
|||
// to healthy or vice versa. For more information, see How Amazon Route 53 Determines
|
||||
// Whether an Endpoint Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html)
|
||||
// in the Amazon Route 53 Developer Guide.
|
||||
//
|
||||
// If you don't specify a value for FailureThreshold, the default value is three
|
||||
// health checks.
|
||||
FailureThreshold *int64 `min:"1" type:"integer"`
|
||||
|
||||
// Amazon Route 53 behavior depends on whether you specify a value for IPAddress.
|
||||
|
@ -11978,7 +11942,7 @@ type UpdateHealthCheckInput struct {
|
|||
// we recommend that you create a separate health check for each endpoint. For
|
||||
// example, create a health check for each HTTP server that is serving content
|
||||
// for www.example.com. For the value of FullyQualifiedDomainName, specify the
|
||||
// domain name of the server (such as us-east-1-www.example.com), not the name
|
||||
// domain name of the server (such as us-east-2-www.example.com), not the name
|
||||
// of the resource record sets (www.example.com).
|
||||
//
|
||||
// In this configuration, if the value of FullyQualifiedDomainName matches the
|
||||
|
@ -12038,6 +12002,16 @@ type UpdateHealthCheckInput struct {
|
|||
// Using an IP address that is returned by DNS, Amazon Route 53 then checks
|
||||
// the health of the endpoint.
|
||||
//
|
||||
// Use one of the following formats for the value of IPAddress:
|
||||
//
|
||||
// * IPv4 address: four values between 0 and 255, separated by periods (.),
|
||||
// for example, 192.0.2.44.
|
||||
//
|
||||
// * IPv6 address: eight groups of four hexadecimal values, separated by
|
||||
// colons (:), for example, 2001:0db8:85a3:0000:0000:abcd:0001:2345. You
|
||||
// can also shorten IPv6 addresses as described in RFC 5952, for example,
|
||||
// 2001:db8:85a3::abcd:1:2345.
|
||||
//
|
||||
// If the endpoint is an EC2 instance, we recommend that you create an Elastic
|
||||
// IP address, associate it with your EC2 instance, and specify the Elastic
|
||||
// IP address for IPAddress. This ensures that the IP address of your instance
|
||||
|
@ -12690,8 +12664,6 @@ const (
|
|||
ComparisonOperatorLessThanOrEqualToThreshold = "LessThanOrEqualToThreshold"
|
||||
)
|
||||
|
||||
// An Amazon EC2 Region that you want Amazon Route 53 to use to perform health
|
||||
// checks.
|
||||
const (
|
||||
// HealthCheckRegionUsEast1 is a HealthCheckRegion enum value
|
||||
HealthCheckRegionUsEast1 = "us-east-1"
|
||||
|
|
|
@ -68,10 +68,9 @@ const (
|
|||
// ErrCodeHealthCheckAlreadyExists for service response error code
|
||||
// "HealthCheckAlreadyExists".
|
||||
//
|
||||
// The health check you're attempting to create already exists.
|
||||
//
|
||||
// Amazon Route 53 returns this error when a health check has already been created
|
||||
// with the specified value for CallerReference.
|
||||
// The health check you're attempting to create already exists. Amazon Route
|
||||
// 53 returns this error when a health check has already been created with the
|
||||
// specified value for CallerReference.
|
||||
ErrCodeHealthCheckAlreadyExists = "HealthCheckAlreadyExists"
|
||||
|
||||
// ErrCodeHealthCheckInUse for service response error code
|
||||
|
@ -92,8 +91,8 @@ const (
|
|||
// ErrCodeHostedZoneAlreadyExists for service response error code
|
||||
// "HostedZoneAlreadyExists".
|
||||
//
|
||||
// The hosted zone you are trying to create already exists. Amazon Route 53
|
||||
// returns this error when a hosted zone has already been created with the specified
|
||||
// The hosted zone you're trying to create already exists. Amazon Route 53 returns
|
||||
// this error when a hosted zone has already been created with the specified
|
||||
// CallerReference.
|
||||
ErrCodeHostedZoneAlreadyExists = "HostedZoneAlreadyExists"
|
||||
|
||||
|
@ -112,14 +111,14 @@ const (
|
|||
// ErrCodeIncompatibleVersion for service response error code
|
||||
// "IncompatibleVersion".
|
||||
//
|
||||
// The resource you are trying to access is unsupported on this Amazon Route
|
||||
// 53 endpoint. Please consider using a newer endpoint or a tool that does so.
|
||||
// The resource you're trying to access is unsupported on this Amazon Route
|
||||
// 53 endpoint.
|
||||
ErrCodeIncompatibleVersion = "IncompatibleVersion"
|
||||
|
||||
// ErrCodeInvalidArgument for service response error code
|
||||
// "InvalidArgument".
|
||||
//
|
||||
// Parameter name and problem.
|
||||
// Parameter name is invalid.
|
||||
ErrCodeInvalidArgument = "InvalidArgument"
|
||||
|
||||
// ErrCodeInvalidChangeBatch for service response error code
|
||||
|
@ -242,6 +241,8 @@ const (
|
|||
|
||||
// ErrCodeThrottlingException for service response error code
|
||||
// "ThrottlingException".
|
||||
//
|
||||
// The limit on the number of requests per second was exceeded.
|
||||
ErrCodeThrottlingException = "ThrottlingException"
|
||||
|
||||
// ErrCodeTooManyHealthChecks for service response error code
|
||||
|
|
|
@ -2149,7 +2149,7 @@ func (c *WAF) GetSampledRequestsRequest(input *GetSampledRequestsInput) (req *re
|
|||
// Gets detailed information about a specified number of requests--a sample--that
|
||||
// AWS WAF randomly selects from among the first 5,000 requests that your AWS
|
||||
// resource received during a time range that you choose. You can specify a
|
||||
// sample size of up to 100 requests, and you can specify any time range in
|
||||
// sample size of up to 500 requests, and you can specify any time range in
|
||||
// the previous three hours.
|
||||
//
|
||||
// GetSampledRequests returns a time range, which is usually the time range
|
||||
|
@ -3969,8 +3969,6 @@ func (c *WAF) UpdateWebACLRequest(input *UpdateWebACLInput) (req *request.Reques
|
|||
// and doesn't evaluate the request against the remaining Rules in the WebACL,
|
||||
// if any.
|
||||
//
|
||||
// * The CloudFront distribution that you want to associate with the WebACL.
|
||||
//
|
||||
// To create and configure a WebACL, perform the following steps:
|
||||
//
|
||||
// Create and update the predicates that you want to include in Rules. For more
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
.PHONY: all clean
|
||||
|
||||
all: .git/hooks/pre-commit
|
||||
go build .
|
||||
|
||||
clean:
|
||||
rm -f terraform-provider-nsone
|
||||
|
||||
.git/hooks/pre-commit:
|
||||
if [ ! -f .git/hooks/pre-commit ]; then ln -s ../../git-hooks/pre-commit .git/hooks/pre-commit; fi
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# NS1 Golang SDK
|
||||
|
||||
The golang client for the NS1 API: https://api.nsone.net/
|
||||
The golang client for the NS1 API: https://ns1.com/api/
|
||||
|
||||
# Installing
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ func (s *APIKeysService) Delete(keyID string) (*http.Response, error) {
|
|||
|
||||
var (
|
||||
// ErrKeyExists bundles PUT create error.
|
||||
ErrKeyExists = errors.New("Key already exists.")
|
||||
ErrKeyExists = errors.New("key already exists")
|
||||
// ErrKeyMissing bundles GET/POST/DELETE error.
|
||||
ErrKeyMissing = errors.New("Key does not exist.")
|
||||
ErrKeyMissing = errors.New("key does not exist")
|
||||
)
|
||||
|
|
|
@ -136,7 +136,7 @@ func (s *TeamsService) Delete(id string) (*http.Response, error) {
|
|||
|
||||
var (
|
||||
// ErrTeamExists bundles PUT create error.
|
||||
ErrTeamExists = errors.New("Team already exists.")
|
||||
ErrTeamExists = errors.New("team already exists")
|
||||
// ErrTeamMissing bundles GET/POST/DELETE error.
|
||||
ErrTeamMissing = errors.New("Team does not exist.")
|
||||
ErrTeamMissing = errors.New("team does not exist")
|
||||
)
|
||||
|
|
|
@ -136,7 +136,7 @@ func (s *UsersService) Delete(username string) (*http.Response, error) {
|
|||
|
||||
var (
|
||||
// ErrUserExists bundles PUT create error.
|
||||
ErrUserExists = errors.New("User already exists.")
|
||||
ErrUserExists = errors.New("user already exists")
|
||||
// ErrUserMissing bundles GET/POST/DELETE error.
|
||||
ErrUserMissing = errors.New("User does not exist.")
|
||||
ErrUserMissing = errors.New("user does not exist")
|
||||
)
|
||||
|
|
|
@ -271,3 +271,18 @@ func parseRate(resp *http.Response) RateLimit {
|
|||
|
||||
return rl
|
||||
}
|
||||
|
||||
// SetTimeParam sets a url timestamp query param given the parameters name.
|
||||
func SetTimeParam(key string, t time.Time) func(*url.Values) {
|
||||
return func(v *url.Values) { v.Set(key, strconv.Itoa(int(t.Unix()))) }
|
||||
}
|
||||
|
||||
// SetBoolParam sets a url boolean query param given the parameters name.
|
||||
func SetBoolParam(key string, b bool) func(*url.Values) {
|
||||
return func(v *url.Values) { v.Set(key, strconv.FormatBool(b)) }
|
||||
}
|
||||
|
||||
// SetStringParam sets a url string query param given the parameters name.
|
||||
func SetStringParam(key, val string) func(*url.Values) {
|
||||
return func(v *url.Values) { v.Set(key, val) }
|
||||
}
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
package rest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestRateLimit(t *testing.T) {
|
||||
r := RateLimit{
|
||||
Limit: 10,
|
||||
Remaining: 10,
|
||||
Period: 10,
|
||||
}
|
||||
if r.WaitTime() != time.Second {
|
||||
t.Error("WaitTime is wrong duration ", r.WaitTime())
|
||||
}
|
||||
if r.PercentageLeft() != 100 {
|
||||
t.Error("PercentLeft != 100")
|
||||
}
|
||||
r.Remaining = 5
|
||||
if r.PercentageLeft() != 50 {
|
||||
t.Error("PercentLeft != 50")
|
||||
}
|
||||
if r.WaitTime() != time.Second {
|
||||
t.Error("WaitTime is wrong duration ", r.WaitTime())
|
||||
}
|
||||
if r.WaitTimeRemaining() != (time.Duration(2) * time.Second) {
|
||||
t.Error("WaitTimeRemaining is wrong duration ", r.WaitTimeRemaining())
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
package account
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestUnmarshalUsers(t *testing.T) {
|
||||
d := []byte(`[
|
||||
{
|
||||
"permissions": {},
|
||||
"teams": [],
|
||||
"email": "support@nsone.net",
|
||||
"last_access": 1376325771.0,
|
||||
"notify": {
|
||||
"billing": true
|
||||
},
|
||||
"name": "API Example",
|
||||
"username": "apiexample"
|
||||
},
|
||||
{
|
||||
"permissions": {
|
||||
"dns": {
|
||||
"view_zones": true,
|
||||
"manage_zones": true,
|
||||
"zones_allow_by_default": false,
|
||||
"zones_deny": [],
|
||||
"zones_allow": ["example.com"]
|
||||
},
|
||||
"data": {
|
||||
"push_to_datafeeds": false,
|
||||
"manage_datasources": false,
|
||||
"manage_datafeeds": false
|
||||
},
|
||||
"account": {
|
||||
"manage_payment_methods": false,
|
||||
"manage_plan": false,
|
||||
"manage_teams": false,
|
||||
"manage_apikeys": false,
|
||||
"manage_account_settings": false,
|
||||
"view_activity_log": false,
|
||||
"view_invoices": false,
|
||||
"manage_users": false
|
||||
},
|
||||
"monitoring": {
|
||||
"manage_lists": false,
|
||||
"manage_jobs": false,
|
||||
"view_jobs": false
|
||||
}
|
||||
},
|
||||
"teams": ["520422919f782d37dffb588a"],
|
||||
"email": "newuser@example.com",
|
||||
"last_access": null,
|
||||
"notify": {
|
||||
"billing": true
|
||||
},
|
||||
"name": "New User",
|
||||
"username": "newuser"
|
||||
}
|
||||
]
|
||||
`)
|
||||
ul := []*User{}
|
||||
if err := json.Unmarshal(d, &ul); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
assert.Equal(t, len(ul), 2, "Userlist should have 2 users")
|
||||
|
||||
u := ul[0]
|
||||
assert.Equal(t, u.TeamIDs, []string{}, "User should have empty teams")
|
||||
assert.Equal(t, u.Email, "support@nsone.net", "User wrong email")
|
||||
assert.Equal(t, u.LastAccess, 1376325771.0, "User wrong last access")
|
||||
assert.Equal(t, u.Name, "API Example", "User wrong name")
|
||||
assert.Equal(t, u.Username, "apiexample", "User wrong username")
|
||||
assert.Equal(t, u.Notify, NotificationSettings{true}, "User wrong notify")
|
||||
assert.Equal(t, u.Permissions, PermissionsMap{}, "User should have empty permissions")
|
||||
|
||||
u2 := ul[1]
|
||||
assert.Equal(t, u2.TeamIDs, []string{"520422919f782d37dffb588a"}, "User should have empty teams")
|
||||
assert.Equal(t, u2.Email, "newuser@example.com", "User wrong email")
|
||||
assert.Equal(t, u2.LastAccess, 0.0, "User wrong last access")
|
||||
assert.Equal(t, u2.Name, "New User", "User wrong name")
|
||||
assert.Equal(t, u2.Username, "newuser", "User wrong username")
|
||||
assert.Equal(t, u.Notify, NotificationSettings{true}, "User wrong notify")
|
||||
|
||||
permMap := PermissionsMap{
|
||||
DNS: PermissionsDNS{
|
||||
ViewZones: true,
|
||||
ManageZones: true,
|
||||
ZonesAllowByDefault: false,
|
||||
ZonesDeny: []string{},
|
||||
ZonesAllow: []string{"example.com"},
|
||||
},
|
||||
Data: PermissionsData{
|
||||
PushToDatafeeds: false,
|
||||
ManageDatasources: false,
|
||||
ManageDatafeeds: false,
|
||||
},
|
||||
Account: PermissionsAccount{
|
||||
ManagePaymentMethods: false,
|
||||
ManagePlan: false,
|
||||
ManageTeams: false,
|
||||
ManageApikeys: false,
|
||||
ManageAccountSettings: false,
|
||||
ViewActivityLog: false,
|
||||
ViewInvoices: false,
|
||||
ManageUsers: false,
|
||||
},
|
||||
Monitoring: PermissionsMonitoring{
|
||||
ManageLists: false,
|
||||
ManageJobs: false,
|
||||
ViewJobs: false,
|
||||
},
|
||||
}
|
||||
assert.Equal(t, u2.Permissions, permMap, "User wrong permissions")
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
package data_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"gopkg.in/ns1/ns1-go.v2/rest/model/data"
|
||||
)
|
||||
|
||||
func ExampleSource() {
|
||||
// Construct an NSONE API data source.
|
||||
source := data.NewSource("my api source", "nsone_v1")
|
||||
fmt.Println(source.ID) // will be empty string
|
||||
fmt.Println(source.Name)
|
||||
fmt.Println(source.Type)
|
||||
// Output:
|
||||
// my api source
|
||||
// nsone_v1
|
||||
}
|
||||
|
||||
func ExampleFeed() {
|
||||
|
||||
// Construct the london data feed.
|
||||
feed := data.NewFeed(
|
||||
"London Feed",
|
||||
data.Config{"label": "London-UK"})
|
||||
fmt.Println(feed.ID) // will be empty string
|
||||
fmt.Println(feed.Name)
|
||||
fmt.Println(feed.Config)
|
||||
// Output:
|
||||
// London Feed
|
||||
// map[label:London-UK]
|
||||
}
|
||||
|
||||
func ExampleMeta() {
|
||||
feedID := "feed_id"
|
||||
|
||||
meta := data.Meta{}
|
||||
meta.Priority = 1
|
||||
meta.Up = data.FeedPtr{FeedID: feedID}
|
||||
fmt.Println(meta.Connections) // will be nil
|
||||
fmt.Println(meta.Priority)
|
||||
fmt.Println(meta.Up)
|
||||
// Output:
|
||||
// <nil>
|
||||
// 1
|
||||
// {feed_id}
|
||||
}
|
||||
|
||||
func ExampleRegions() {
|
||||
feedPtr := data.FeedPtr{FeedID: "feed_id"}
|
||||
|
||||
regions := data.Regions{}
|
||||
// Set a regions' 'up' metavalue to false('down').
|
||||
regions["some_region"] = data.Region{
|
||||
Meta: data.Meta{Up: false},
|
||||
}
|
||||
// Set a regions' 'connections' metavalue to receive from a feed.
|
||||
regions["other_region"] = data.Region{
|
||||
Meta: data.Meta{Connections: feedPtr},
|
||||
}
|
||||
fmt.Println(regions["some_region"].Meta.Up)
|
||||
fmt.Println(regions["some_region"].Meta.Priority)
|
||||
fmt.Println(regions["other_region"].Meta.Connections)
|
||||
fmt.Println(regions["other_region"].Meta.Priority)
|
||||
// Output:
|
||||
// false
|
||||
// <nil>
|
||||
// {feed_id}
|
||||
// <nil>
|
||||
}
|
|
@ -38,7 +38,7 @@ type Meta struct {
|
|||
// Indicates the "load average".
|
||||
// Values must be positive, and will be rounded to the nearest tenth.
|
||||
// float64 or FeedPtr.
|
||||
LoadAvg interface{} `json:",loadavg,omitempty"`
|
||||
LoadAvg interface{} `json:"loadavg,omitempty"`
|
||||
|
||||
// The Job ID of a Pulsar telemetry gathering job and routing granularities
|
||||
// to associate with.
|
||||
|
|
|
@ -1,141 +0,0 @@
|
|||
package dns_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"gopkg.in/ns1/ns1-go.v2/rest/model/data"
|
||||
"gopkg.in/ns1/ns1-go.v2/rest/model/dns"
|
||||
"gopkg.in/ns1/ns1-go.v2/rest/model/filter"
|
||||
)
|
||||
|
||||
func ExampleZone() {
|
||||
z := dns.NewZone("example.com")
|
||||
|
||||
fmt.Println(z)
|
||||
// Output:
|
||||
// example.com
|
||||
}
|
||||
|
||||
// Example references https://ns1.com/articles/primary-dns-with-ns1
|
||||
func ExamplePrimaryZone() {
|
||||
// Secondary/slave dns server info.
|
||||
secondary := dns.ZoneSecondaryServer{
|
||||
IP: "1.2.3.4",
|
||||
Port: 53,
|
||||
Notify: true,
|
||||
}
|
||||
|
||||
// Construct the primary/master zone.
|
||||
domain := "masterzone.example"
|
||||
|
||||
masterZone := dns.NewZone(domain)
|
||||
masterZone.MakePrimary(secondary)
|
||||
|
||||
b, _ := json.MarshalIndent(masterZone, "", " ")
|
||||
|
||||
fmt.Println(string(b))
|
||||
// Output:
|
||||
// {
|
||||
// "zone": "masterzone.example",
|
||||
// "primary": {
|
||||
// "enabled": true,
|
||||
// "secondaries": [
|
||||
// {
|
||||
// "ip": "1.2.3.4",
|
||||
// "port": 53,
|
||||
// "notify": true
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
func ExampleRecord() {
|
||||
// Construct the A record
|
||||
record := dns.NewRecord("test.com", "a", "A")
|
||||
record.TTL = 300
|
||||
|
||||
// Construct primary answer(higher priority)
|
||||
pAns := dns.NewAv4Answer("1.1.1.1")
|
||||
pAns.Meta.Priority = 1
|
||||
pAns.Meta.Up = data.FeedPtr{FeedID: "feed1_id"}
|
||||
|
||||
// Construct secondary answer(lower priority)
|
||||
sAns := dns.NewAv4Answer("2.2.2.2")
|
||||
sAns.Meta.Priority = 2
|
||||
sAns.Meta.Up = data.FeedPtr{FeedID: "feed2_id"}
|
||||
|
||||
// Add both answers to record
|
||||
record.AddAnswer(pAns)
|
||||
record.AddAnswer(sAns)
|
||||
|
||||
// Construct and add both filters to the record(ORDER MATTERS)
|
||||
record.AddFilter(filter.NewUp())
|
||||
record.AddFilter(filter.NewSelFirstN(1))
|
||||
|
||||
// Add region 'test' to record(set as down)
|
||||
record.Regions["test"] = data.Region{Meta: data.Meta{Up: false}}
|
||||
|
||||
fmt.Println(record)
|
||||
fmt.Println(record.TTL)
|
||||
|
||||
fmt.Println("Primary answer:")
|
||||
fmt.Println(record.Answers[0])
|
||||
fmt.Println(record.Answers[0].Meta.Priority)
|
||||
fmt.Println(record.Answers[0].Meta.Up)
|
||||
|
||||
fmt.Println("Secondary answer:")
|
||||
fmt.Println(record.Answers[1])
|
||||
fmt.Println(record.Answers[1].Meta.Priority)
|
||||
fmt.Println(record.Answers[1].Meta.Up)
|
||||
|
||||
fmt.Println("First Filter in Chain:")
|
||||
fmt.Println(record.Filters[0].Type)
|
||||
fmt.Println(record.Filters[0].Config)
|
||||
|
||||
fmt.Println("Second Filter in Chain:")
|
||||
fmt.Println(record.Filters[1].Type)
|
||||
fmt.Println(record.Filters[1].Config)
|
||||
|
||||
fmt.Println("Regions:")
|
||||
fmt.Println(record.Regions["test"].Meta.Up)
|
||||
|
||||
// Output:
|
||||
// a.test.com A
|
||||
// 300
|
||||
// Primary answer:
|
||||
// 1.1.1.1
|
||||
// 1
|
||||
// {feed1_id}
|
||||
// Secondary answer:
|
||||
// 2.2.2.2
|
||||
// 2
|
||||
// {feed2_id}
|
||||
// First Filter in Chain:
|
||||
// up
|
||||
// map[]
|
||||
// Second Filter in Chain:
|
||||
// select_first_n
|
||||
// map[N:1]
|
||||
// Regions:
|
||||
// false
|
||||
}
|
||||
|
||||
func ExampleRecordLink() {
|
||||
// Construct the src record
|
||||
srcRecord := dns.NewRecord("test.com", "a", "A")
|
||||
srcRecord.TTL = 300
|
||||
srcRecord.Meta.Priority = 2
|
||||
|
||||
linkedRecord := dns.NewRecord("test.com", "l", "A")
|
||||
linkedRecord.LinkTo(srcRecord.Domain)
|
||||
fmt.Println(linkedRecord)
|
||||
fmt.Println(linkedRecord.Meta)
|
||||
fmt.Println(linkedRecord.Answers)
|
||||
// Output:
|
||||
// l.test.com A
|
||||
// <nil>
|
||||
// []
|
||||
}
|
|
@ -19,10 +19,10 @@ type Job struct {
|
|||
Config Config `json:"config"`
|
||||
|
||||
// The current status of the monitor.
|
||||
Status map[string]Status `json:"status,omitempty"`
|
||||
Status map[string]*Status `json:"status,omitempty"`
|
||||
|
||||
// Rules for determining failure conditions.
|
||||
Rules []*Rule `json:"rules"`
|
||||
Rules []*Rule `json:"rules,omitempty"`
|
||||
|
||||
// List of regions in which to run the monitor.
|
||||
// eg, ["dal", "sin", "sjc", "lga", "ams"]
|
||||
|
@ -66,7 +66,7 @@ type Job struct {
|
|||
|
||||
// If true, notifications are sent for any regional failure (and failback if desired),
|
||||
// in addition to global state notifications.
|
||||
NotifyRegional bool `json:"notidy_regional"`
|
||||
NotifyRegional bool `json:"notify_regional"`
|
||||
|
||||
// If true, a notification is sent when a job returns to an "up" state.
|
||||
NotifyFailback bool `json:"notify_failback"`
|
||||
|
@ -99,6 +99,15 @@ type Status struct {
|
|||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
// StatusLog wraps an NS1 /monitoring/history resource
|
||||
type StatusLog struct {
|
||||
Job string `json:"job"`
|
||||
Region string `json:"region"`
|
||||
Status string `json:"status"`
|
||||
Since int `json:"since"`
|
||||
Until int `json:"until"`
|
||||
}
|
||||
|
||||
// Rule wraps an element of a Job's "rules" attribute
|
||||
type Rule struct {
|
||||
Key string `json:"key"`
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
package monitor
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestUnmarshalJobs(t *testing.T) {
|
||||
data := []byte(`[
|
||||
{
|
||||
"id": "52a27d4397d5f07003fdbe7b",
|
||||
"config": {
|
||||
"host": "1.2.3.4"
|
||||
},
|
||||
"status": {
|
||||
"lga": {
|
||||
"since": 1389407609,
|
||||
"status": "up"
|
||||
},
|
||||
"global": {
|
||||
"since": 1389407609,
|
||||
"status": "up"
|
||||
},
|
||||
"sjc": {
|
||||
"since": 1389404014,
|
||||
"status": "up"
|
||||
}
|
||||
},
|
||||
"rules": [
|
||||
{
|
||||
"key": "rtt",
|
||||
"value": 100,
|
||||
"comparison": "<"
|
||||
}
|
||||
],
|
||||
"job_type": "ping",
|
||||
"regions": [
|
||||
"lga",
|
||||
"sjc"
|
||||
],
|
||||
"active": true,
|
||||
"frequency": 60,
|
||||
"policy": "quorum",
|
||||
"region_scope": "fixed"
|
||||
}
|
||||
]`)
|
||||
mjl := []*Job{}
|
||||
if err := json.Unmarshal(data, &mjl); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if len(mjl) != 1 {
|
||||
fmt.Println(mjl)
|
||||
t.Error("Do not have any jobs")
|
||||
}
|
||||
j := mjl[0]
|
||||
if j.ID != "52a27d4397d5f07003fdbe7b" {
|
||||
t.Error("Wrong ID")
|
||||
}
|
||||
conf := j.Config
|
||||
if conf["host"] != "1.2.3.4" {
|
||||
t.Error("Wrong host")
|
||||
}
|
||||
status := j.Status["global"]
|
||||
if status.Since != 1389407609 {
|
||||
t.Error("since has unexpected value")
|
||||
}
|
||||
if status.Status != "up" {
|
||||
t.Error("Status is not up")
|
||||
}
|
||||
r := j.Rules[0]
|
||||
assert.Equal(t, r.Key, "rtt", "RTT rule key is wrong")
|
||||
assert.Equal(t, r.Value.(float64), float64(100), "RTT rule value is wrong")
|
||||
if r.Comparison != "<" {
|
||||
t.Error("RTT rule comparison is wrong")
|
||||
}
|
||||
if j.Type != "ping" {
|
||||
t.Error("Jobtype is wrong")
|
||||
}
|
||||
if j.Regions[0] != "lga" {
|
||||
t.Error("First region is not lga")
|
||||
}
|
||||
if !j.Active {
|
||||
t.Error("Job is not active")
|
||||
}
|
||||
if j.Frequency != 60 {
|
||||
t.Error("Job frequency != 60")
|
||||
}
|
||||
if j.Policy != "quorum" {
|
||||
t.Error("Job policy is not quorum")
|
||||
}
|
||||
if j.RegionScope != "fixed" {
|
||||
t.Error("Job region scope is not fixed")
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package rest
|
|||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"gopkg.in/ns1/ns1-go.v2/rest/model/monitor"
|
||||
)
|
||||
|
@ -106,3 +107,28 @@ func (s *JobsService) Delete(id string) (*http.Response, error) {
|
|||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// History takes an ID and returns status log history for a specific monitoring job.
|
||||
//
|
||||
// NS1 API docs: https://ns1.com/api/#history-get
|
||||
func (s *JobsService) History(id string, opts ...func(*url.Values)) ([]*monitor.StatusLog, *http.Response, error) {
|
||||
v := url.Values{}
|
||||
for _, opt := range opts {
|
||||
opt(&v)
|
||||
}
|
||||
|
||||
path := fmt.Sprintf("%s/%s?%s", "monitoring/history", id, v.Encode())
|
||||
|
||||
req, err := s.client.NewRequest("GET", path, nil)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
var slgs []*monitor.StatusLog
|
||||
resp, err := s.client.Do(req, &slgs)
|
||||
if err != nil {
|
||||
return nil, resp, err
|
||||
}
|
||||
|
||||
return slgs, resp, nil
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ func (s *NotificationsService) Delete(listID string) (*http.Response, error) {
|
|||
|
||||
var (
|
||||
// ErrListExists bundles PUT create error.
|
||||
ErrListExists = errors.New("Notify List already exists.")
|
||||
ErrListExists = errors.New("notify List already exists")
|
||||
// ErrListMissing bundles GET/POST/DELETE error.
|
||||
ErrListMissing = errors.New("Notify List does not exist.")
|
||||
ErrListMissing = errors.New("notify List does not exist")
|
||||
)
|
||||
|
|
|
@ -128,7 +128,7 @@ func (s *RecordsService) Delete(zone string, domain string, t string) (*http.Res
|
|||
|
||||
var (
|
||||
// ErrRecordExists bundles PUT create error.
|
||||
ErrRecordExists = errors.New("Record already exists.")
|
||||
ErrRecordExists = errors.New("record already exists")
|
||||
// ErrRecordMissing bundles GET/POST/DELETE error.
|
||||
ErrRecordMissing = errors.New("Record does not exist.")
|
||||
ErrRecordMissing = errors.New("record does not exist")
|
||||
)
|
||||
|
|
|
@ -138,7 +138,7 @@ func (s *ZonesService) Delete(zone string) (*http.Response, error) {
|
|||
|
||||
var (
|
||||
// ErrZoneExists bundles PUT create error.
|
||||
ErrZoneExists = errors.New("Zone already exists.")
|
||||
ErrZoneExists = errors.New("zone already exists")
|
||||
// ErrZoneMissing bundles GET/POST/DELETE error.
|
||||
ErrZoneMissing = errors.New("Zone does not exist.")
|
||||
ErrZoneMissing = errors.New("zone does not exist")
|
||||
)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -42,7 +42,7 @@ omitted). Valid items are `global` (for `cloudfront`) as well as all AWS regions
|
|||
(e.g. `eu-central-1`)
|
||||
|
||||
* `services` - (Required) Filter IP ranges by services. Valid items are `amazon`
|
||||
(for amazon.com), `cloudfront`, `ec2`, `route53` and `route53_healthchecks`.
|
||||
(for amazon.com), `cloudfront`, `ec2`, `route53`, `route53_healthchecks` and `S3`.
|
||||
|
||||
~> **NOTE:** If the specified combination of regions and services does not yield any
|
||||
CIDR blocks, Terraform will fail.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue