deps: Bump terraform-provider-aws@v1.8.0 and aws-sdk-go@v1.12.70

This commit is contained in:
Brian Flad 2018-02-05 20:06:50 -05:00
parent 8743edc4c9
commit b924e8cba5
16 changed files with 1667 additions and 1294 deletions

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"io"
"os"
"github.com/aws/aws-sdk-go/aws/awserr"
)
@ -84,11 +85,34 @@ func decodeV3Endpoints(modelDef modelDefinition, opts DecodeModelOptions) (Resol
custAddEC2Metadata(p)
custAddS3DualStack(p)
custRmIotDataService(p)
custFixCloudHSMv2SigningName(p)
}
return ps, nil
}
func custFixCloudHSMv2SigningName(p *partition) {
// Workaround for aws/aws-sdk-go#1745 until the endpoint model can be
// fixed upstream. TODO remove this once the endpoints model is updated.
s, ok := p.Services["cloudhsmv2"]
if !ok {
return
}
if len(s.Defaults.CredentialScope.Service) != 0 {
fmt.Fprintf(os.Stderr, "cloudhsmv2 signing name already set, ignoring override.\n")
// If the value is already set don't override
return
}
s.Defaults.CredentialScope.Service = "cloudhsm"
fmt.Fprintf(os.Stderr, "cloudhsmv2 signing name not set, overriding.\n")
p.Services["cloudhsmv2"] = s
}
func custAddS3DualStack(p *partition) {
if p.ID != "aws" {
return

View File

@ -52,6 +52,7 @@ const (
Appstream2ServiceID = "appstream2" // Appstream2.
AthenaServiceID = "athena" // Athena.
AutoscalingServiceID = "autoscaling" // Autoscaling.
AutoscalingPlansServiceID = "autoscaling-plans" // AutoscalingPlans.
BatchServiceID = "batch" // Batch.
BudgetsServiceID = "budgets" // Budgets.
ClouddirectoryServiceID = "clouddirectory" // Clouddirectory.
@ -370,6 +371,22 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
"autoscaling-plans": service{
Defaults: endpoint{
Hostname: "autoscaling.{region}.amazonaws.com",
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Service: "autoscaling-plans",
},
},
Endpoints: endpoints{
"ap-southeast-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
"batch": service{
Endpoints: endpoints{
@ -459,7 +476,11 @@ var awsPartition = partition{
},
},
"cloudhsmv2": service{
Defaults: endpoint{
CredentialScope: credentialScope{
Service: "cloudhsm",
},
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-south-1": endpoint{},
@ -2430,6 +2451,12 @@ var awsusgovPartition = partition{
},
},
},
"ecs": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"elasticache": service{
Endpoints: endpoints{

View File

@ -142,13 +142,28 @@ func (r *Request) nextPageTokens() []interface{} {
tokens := []interface{}{}
tokenAdded := false
for _, outToken := range r.Operation.OutputTokens {
v, _ := awsutil.ValuesAtPath(r.Data, outToken)
if len(v) > 0 {
tokens = append(tokens, v[0])
tokenAdded = true
} else {
vs, _ := awsutil.ValuesAtPath(r.Data, outToken)
if len(vs) == 0 {
tokens = append(tokens, nil)
continue
}
v := vs[0]
switch tv := v.(type) {
case *string:
if len(aws.StringValue(tv)) == 0 {
tokens = append(tokens, nil)
continue
}
case string:
if len(tv) == 0 {
tokens = append(tokens, nil)
continue
}
}
tokenAdded = true
tokens = append(tokens, v)
}
if !tokenAdded {
return nil

View File

@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
const SDKVersion = "1.12.67"
const SDKVersion = "1.12.70"

View File

@ -388,7 +388,7 @@ func (c *CodeBuild) CreateWebhookRequest(input *CreateWebhookInput) (req *reques
// AWS CodePipeline. Because billing is on a per-build basis, you will be billed
// for both builds. Therefore, if you are using AWS CodePipeline, we recommend
// that you disable webhooks in CodeBuild. In the AWS CodeBuild console, clear
// the Webhook box. For more information, see step 9 in Change a Build Projects
// the Webhook box. For more information, see step 9 in Change a Build Project's
// Settings (http://docs.aws.amazon.com/codebuild/latest/userguide/change-project.html#change-project-console).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@ -3430,6 +3430,9 @@ func (s *ProjectCache) SetType(v string) *ProjectCache {
type ProjectEnvironment struct {
_ struct{} `type:"structure"`
// The certificate to use with this build project.
Certificate *string `locationName:"certificate" type:"string"`
// Information about the compute resources the build project will use. Available
// values include:
//
@ -3516,6 +3519,12 @@ func (s *ProjectEnvironment) Validate() error {
return nil
}
// SetCertificate sets the Certificate field's value.
func (s *ProjectEnvironment) SetCertificate(v string) *ProjectEnvironment {
s.Certificate = &v
return s
}
// SetComputeType sets the ComputeType field's value.
func (s *ProjectEnvironment) SetComputeType(v string) *ProjectEnvironment {
s.ComputeType = &v
@ -3565,6 +3574,13 @@ type ProjectSource struct {
// the source code to be built.
Buildspec *string `locationName:"buildspec" type:"string"`
// Information about the git clone depth for the build project.
GitCloneDepth *int64 `locationName:"gitCloneDepth" type:"integer"`
// Enable this flag to ignore SSL warnings while connecting to the project source
// code.
InsecureSsl *bool `locationName:"insecureSsl" type:"boolean"`
// Information about the location of the source code to be built. Valid values
// include:
//
@ -3665,6 +3681,18 @@ func (s *ProjectSource) SetBuildspec(v string) *ProjectSource {
return s
}
// SetGitCloneDepth sets the GitCloneDepth field's value.
func (s *ProjectSource) SetGitCloneDepth(v int64) *ProjectSource {
s.GitCloneDepth = &v
return s
}
// SetInsecureSsl sets the InsecureSsl field's value.
func (s *ProjectSource) SetInsecureSsl(v bool) *ProjectSource {
s.InsecureSsl = &v
return s
}
// SetLocation sets the Location field's value.
func (s *ProjectSource) SetLocation(v string) *ProjectSource {
s.Location = &v
@ -3748,6 +3776,10 @@ type StartBuildInput struct {
// ones already defined in the build project.
EnvironmentVariablesOverride []*EnvironmentVariable `locationName:"environmentVariablesOverride" type:"list"`
// The user-defined depth of history, with a minimum value of 0, that overrides,
// for this build only, any previous depth of history defined in the build project.
GitCloneDepthOverride *int64 `locationName:"gitCloneDepthOverride" type:"integer"`
// The name of the build project to start running a build.
//
// ProjectName is a required field
@ -3841,6 +3873,12 @@ func (s *StartBuildInput) SetEnvironmentVariablesOverride(v []*EnvironmentVariab
return s
}
// SetGitCloneDepthOverride sets the GitCloneDepthOverride field's value.
func (s *StartBuildInput) SetGitCloneDepthOverride(v int64) *StartBuildInput {
s.GitCloneDepthOverride = &v
return s
}
// SetProjectName sets the ProjectName field's value.
func (s *StartBuildInput) SetProjectName(v string) *StartBuildInput {
s.ProjectName = &v
@ -4288,6 +4326,14 @@ func (s *VpcConfig) SetVpcId(v string) *VpcConfig {
type Webhook struct {
_ struct{} `type:"structure"`
// This is the server endpoint that will receive the webhook payload.
PayloadUrl *string `locationName:"payloadUrl" min:"1" type:"string"`
// Use this secret while creating a webhook in GitHub for Enterprise. The secret
// allows webhook requests sent by GitHub for Enterprise to be authenticated
// by AWS CodeBuild.
Secret *string `locationName:"secret" min:"1" type:"string"`
// The URL to the webhook.
Url *string `locationName:"url" min:"1" type:"string"`
}
@ -4302,6 +4348,18 @@ func (s Webhook) GoString() string {
return s.String()
}
// SetPayloadUrl sets the PayloadUrl field's value.
func (s *Webhook) SetPayloadUrl(v string) *Webhook {
s.PayloadUrl = &v
return s
}
// SetSecret sets the Secret field's value.
func (s *Webhook) SetSecret(v string) *Webhook {
s.Secret = &v
return s
}
// SetUrl sets the Url field's value.
func (s *Webhook) SetUrl(v string) *Webhook {
s.Url = &v
@ -4478,6 +4536,9 @@ const (
// SourceTypeBitbucket is a SourceType enum value
SourceTypeBitbucket = "BITBUCKET"
// SourceTypeGithubEnterprise is a SourceType enum value
SourceTypeGithubEnterprise = "GITHUB_ENTERPRISE"
)
const (

View File

@ -2765,7 +2765,7 @@ func (c *DeviceFarm) ListJobsRequest(input *ListJobsInput) (req *request.Request
// ListJobs API operation for AWS Device Farm.
//
// Gets information about jobs.
// Gets information about jobs for a given test run.
//
// 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
@ -3919,7 +3919,7 @@ func (c *DeviceFarm) ListSuitesRequest(input *ListSuitesInput) (req *request.Req
// ListSuites API operation for AWS Device Farm.
//
// Gets information about suites.
// Gets information about test suites for a given job.
//
// 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
@ -4063,7 +4063,7 @@ func (c *DeviceFarm) ListTestsRequest(input *ListTestsInput) (req *request.Reque
// ListTests API operation for AWS Device Farm.
//
// Gets information about tests.
// Gets information about tests in a given test suite.
//
// 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
@ -5885,7 +5885,7 @@ type CreateRemoteAccessSessionInput struct {
// Unique identifier for the client. If you want access to multiple devices
// on the same client, you should pass the same clientId value in each call
// to CreateRemoteAccessSession. This is required only if remoteDebugEnabled
// is set to true true.
// is set to true.
ClientId *string `locationName:"clientId" type:"string"`
// The configuration information for the remote access session request.
@ -5897,6 +5897,20 @@ type CreateRemoteAccessSessionInput struct {
// DeviceArn is a required field
DeviceArn *string `locationName:"deviceArn" min:"32" type:"string" required:"true"`
// The interaction mode of the remote access session. Valid values are:
//
// * INTERACTIVE: You can interact with the iOS device by viewing, touching,
// and rotating the screen. You cannot run XCUITest framework-based tests
// in this mode.
//
// * NO_VIDEO: You are connected to the device but cannot interact with it
// or view the screen. This mode has the fastest test execution speed. You
// can run XCUITest framework-based tests in this mode.
//
// * VIDEO_ONLY: You can view the screen but cannot touch or rotate it. You
// can run XCUITest framework-based tests and watch the screen in this mode.
InteractionMode *string `locationName:"interactionMode" type:"string" enum:"InteractionMode"`
// The name of the remote access session that you wish to create.
Name *string `locationName:"name" type:"string"`
@ -5910,6 +5924,13 @@ type CreateRemoteAccessSessionInput struct {
// remote access session.
RemoteDebugEnabled *bool `locationName:"remoteDebugEnabled" type:"boolean"`
// The Amazon Resource Name (ARN) for the app to be recorded in the remote access
// session.
RemoteRecordAppArn *string `locationName:"remoteRecordAppArn" min:"32" type:"string"`
// Set to true to enable remote recording for the remote access session.
RemoteRecordEnabled *bool `locationName:"remoteRecordEnabled" type:"boolean"`
// The public key of the ssh key pair you want to use for connecting to remote
// devices in your remote debugging session. This is only required if remoteDebugEnabled
// is set to true.
@ -5941,6 +5962,9 @@ func (s *CreateRemoteAccessSessionInput) Validate() error {
if s.ProjectArn != nil && len(*s.ProjectArn) < 32 {
invalidParams.Add(request.NewErrParamMinLen("ProjectArn", 32))
}
if s.RemoteRecordAppArn != nil && len(*s.RemoteRecordAppArn) < 32 {
invalidParams.Add(request.NewErrParamMinLen("RemoteRecordAppArn", 32))
}
if invalidParams.Len() > 0 {
return invalidParams
@ -5966,6 +5990,12 @@ func (s *CreateRemoteAccessSessionInput) SetDeviceArn(v string) *CreateRemoteAcc
return s
}
// SetInteractionMode sets the InteractionMode field's value.
func (s *CreateRemoteAccessSessionInput) SetInteractionMode(v string) *CreateRemoteAccessSessionInput {
s.InteractionMode = &v
return s
}
// SetName sets the Name field's value.
func (s *CreateRemoteAccessSessionInput) SetName(v string) *CreateRemoteAccessSessionInput {
s.Name = &v
@ -5984,6 +6014,18 @@ func (s *CreateRemoteAccessSessionInput) SetRemoteDebugEnabled(v bool) *CreateRe
return s
}
// SetRemoteRecordAppArn sets the RemoteRecordAppArn field's value.
func (s *CreateRemoteAccessSessionInput) SetRemoteRecordAppArn(v string) *CreateRemoteAccessSessionInput {
s.RemoteRecordAppArn = &v
return s
}
// SetRemoteRecordEnabled sets the RemoteRecordEnabled field's value.
func (s *CreateRemoteAccessSessionInput) SetRemoteRecordEnabled(v bool) *CreateRemoteAccessSessionInput {
s.RemoteRecordEnabled = &v
return s
}
// SetSshPublicKey sets the SshPublicKey field's value.
func (s *CreateRemoteAccessSessionInput) SetSshPublicKey(v string) *CreateRemoteAccessSessionInput {
s.SshPublicKey = &v
@ -6617,6 +6659,9 @@ type Device struct {
// The device's model name.
Model *string `locationName:"model" type:"string"`
// The device's model ID.
ModelId *string `locationName:"modelId" type:"string"`
// The device's display name.
Name *string `locationName:"name" type:"string"`
@ -6721,6 +6766,12 @@ func (s *Device) SetModel(v string) *Device {
return s
}
// SetModelId sets the ModelId field's value.
func (s *Device) SetModelId(v string) *Device {
s.ModelId = &v
return s
}
// SetName sets the Name field's value.
func (s *Device) SetName(v string) *Device {
s.Name = &v
@ -8562,7 +8613,7 @@ func (s *ListDevicesOutput) SetNextToken(v string) *ListDevicesOutput {
type ListJobsInput struct {
_ struct{} `type:"structure"`
// The jobs' ARNs.
// The run's Amazon Resource Name (ARN).
//
// Arn is a required field
Arn *string `locationName:"arn" min:"32" type:"string" required:"true"`
@ -9344,7 +9395,7 @@ func (s *ListSamplesOutput) SetSamples(v []*Sample) *ListSamplesOutput {
type ListSuitesInput struct {
_ struct{} `type:"structure"`
// The suites' ARNs.
// The job's Amazon Resource Name (ARN).
//
// Arn is a required field
Arn *string `locationName:"arn" min:"32" type:"string" required:"true"`
@ -9436,7 +9487,7 @@ func (s *ListSuitesOutput) SetSuites(v []*Suite) *ListSuitesOutput {
type ListTestsInput struct {
_ struct{} `type:"structure"`
// The tests' ARNs.
// The test suite's Amazon Resource Name (ARN).
//
// Arn is a required field
Arn *string `locationName:"arn" min:"32" type:"string" required:"true"`
@ -10543,6 +10594,20 @@ type RemoteAccessSession struct {
// Only returned if remote debugging is enabled for the remote access session.
HostAddress *string `locationName:"hostAddress" type:"string"`
// The interaction mode of the remote access session. Valid values are:
//
// * INTERACTIVE: You can interact with the iOS device by viewing, touching,
// and rotating the screen. You cannot run XCUITest framework-based tests
// in this mode.
//
// * NO_VIDEO: You are connected to the device but cannot interact with it
// or view the screen. This mode has the fastest test execution speed. You
// can run XCUITest framework-based tests in this mode.
//
// * VIDEO_ONLY: You can view the screen but cannot touch or rotate it. You
// can run XCUITest framework-based tests and watch the screen in this mode.
InteractionMode *string `locationName:"interactionMode" type:"string" enum:"InteractionMode"`
// A message about the remote access session.
Message *string `locationName:"message" type:"string"`
@ -10553,6 +10618,14 @@ type RemoteAccessSession struct {
// session.
RemoteDebugEnabled *bool `locationName:"remoteDebugEnabled" type:"boolean"`
// The Amazon Resource Name (ARN) for the app to be recorded in the remote access
// session.
RemoteRecordAppArn *string `locationName:"remoteRecordAppArn" min:"32" type:"string"`
// This flag is set to true if remote recording is enabled for the remote access
// session.
RemoteRecordEnabled *bool `locationName:"remoteRecordEnabled" type:"boolean"`
// The result of the remote access session. Can be any of the following:
//
// * PENDING: A pending condition.
@ -10662,6 +10735,12 @@ func (s *RemoteAccessSession) SetHostAddress(v string) *RemoteAccessSession {
return s
}
// SetInteractionMode sets the InteractionMode field's value.
func (s *RemoteAccessSession) SetInteractionMode(v string) *RemoteAccessSession {
s.InteractionMode = &v
return s
}
// SetMessage sets the Message field's value.
func (s *RemoteAccessSession) SetMessage(v string) *RemoteAccessSession {
s.Message = &v
@ -10680,6 +10759,18 @@ func (s *RemoteAccessSession) SetRemoteDebugEnabled(v bool) *RemoteAccessSession
return s
}
// SetRemoteRecordAppArn sets the RemoteRecordAppArn field's value.
func (s *RemoteAccessSession) SetRemoteRecordAppArn(v string) *RemoteAccessSession {
s.RemoteRecordAppArn = &v
return s
}
// SetRemoteRecordEnabled sets the RemoteRecordEnabled field's value.
func (s *RemoteAccessSession) SetRemoteRecordEnabled(v bool) *RemoteAccessSession {
s.RemoteRecordEnabled = &v
return s
}
// SetResult sets the Result field's value.
func (s *RemoteAccessSession) SetResult(v string) *RemoteAccessSession {
s.Result = &v
@ -10886,6 +10977,9 @@ func (s *Rule) SetValue(v string) *Rule {
type Run struct {
_ struct{} `type:"structure"`
// An app to upload or that has been uploaded.
AppUpload *string `locationName:"appUpload" min:"32" type:"string"`
// The run's ARN.
Arn *string `locationName:"arn" min:"32" type:"string"`
@ -10908,6 +11002,22 @@ type Run struct {
// Represents the total (metered or unmetered) minutes used by the test run.
DeviceMinutes *DeviceMinutes `locationName:"deviceMinutes" type:"structure"`
// The ARN of the device pool for the run.
DevicePoolArn *string `locationName:"devicePoolArn" min:"32" type:"string"`
// For fuzz tests, this is the number of events, between 1 and 10000, that the
// UI fuzz test should perform.
EventCount *int64 `locationName:"eventCount" type:"integer"`
// The number of minutes the job will execute before it times out.
JobTimeoutMinutes *int64 `locationName:"jobTimeoutMinutes" type:"integer"`
// Information about the locale that is used for the run.
Locale *string `locationName:"locale" type:"string"`
// Information about the location that is used for the run.
Location *Location `locationName:"location" type:"structure"`
// A message about the run's result.
Message *string `locationName:"message" type:"string"`
@ -10931,6 +11041,9 @@ type Run struct {
// * IOS: The iOS platform.
Platform *string `locationName:"platform" type:"string" enum:"DevicePlatform"`
// Information about the radio states for the run.
Radios *Radios `locationName:"radios" type:"structure"`
// The run's result.
//
// Allowed values include:
@ -10954,6 +11067,10 @@ type Run struct {
// if the result is skipped because of test package parsing failure.
ResultCode *string `locationName:"resultCode" type:"string" enum:"ExecutionResultCode"`
// For fuzz tests, this is a seed to use for randomizing the UI fuzz test. Using
// the same seed value between tests ensures identical event sequences.
Seed *int64 `locationName:"seed" type:"integer"`
// The run's start time.
Started *time.Time `locationName:"started" type:"timestamp" timestampFormat:"unix"`
@ -11020,6 +11137,10 @@ type Run struct {
//
// * XCTEST_UI: The XCode UI test type.
Type *string `locationName:"type" type:"string" enum:"TestType"`
// A pre-signed Amazon S3 URL that can be used with a corresponding GET request
// to download the symbol file for the run.
WebUrl *string `locationName:"webUrl" type:"string"`
}
// String returns the string representation
@ -11032,6 +11153,12 @@ func (s Run) GoString() string {
return s.String()
}
// SetAppUpload sets the AppUpload field's value.
func (s *Run) SetAppUpload(v string) *Run {
s.AppUpload = &v
return s
}
// SetArn sets the Arn field's value.
func (s *Run) SetArn(v string) *Run {
s.Arn = &v
@ -11074,6 +11201,36 @@ func (s *Run) SetDeviceMinutes(v *DeviceMinutes) *Run {
return s
}
// SetDevicePoolArn sets the DevicePoolArn field's value.
func (s *Run) SetDevicePoolArn(v string) *Run {
s.DevicePoolArn = &v
return s
}
// SetEventCount sets the EventCount field's value.
func (s *Run) SetEventCount(v int64) *Run {
s.EventCount = &v
return s
}
// SetJobTimeoutMinutes sets the JobTimeoutMinutes field's value.
func (s *Run) SetJobTimeoutMinutes(v int64) *Run {
s.JobTimeoutMinutes = &v
return s
}
// SetLocale sets the Locale field's value.
func (s *Run) SetLocale(v string) *Run {
s.Locale = &v
return s
}
// SetLocation sets the Location field's value.
func (s *Run) SetLocation(v *Location) *Run {
s.Location = v
return s
}
// SetMessage sets the Message field's value.
func (s *Run) SetMessage(v string) *Run {
s.Message = &v
@ -11104,6 +11261,12 @@ func (s *Run) SetPlatform(v string) *Run {
return s
}
// SetRadios sets the Radios field's value.
func (s *Run) SetRadios(v *Radios) *Run {
s.Radios = v
return s
}
// SetResult sets the Result field's value.
func (s *Run) SetResult(v string) *Run {
s.Result = &v
@ -11116,6 +11279,12 @@ func (s *Run) SetResultCode(v string) *Run {
return s
}
// SetSeed sets the Seed field's value.
func (s *Run) SetSeed(v int64) *Run {
s.Seed = &v
return s
}
// SetStarted sets the Started field's value.
func (s *Run) SetStarted(v time.Time) *Run {
s.Started = &v
@ -11146,6 +11315,12 @@ func (s *Run) SetType(v string) *Run {
return s
}
// SetWebUrl sets the WebUrl field's value.
func (s *Run) SetWebUrl(v string) *Run {
s.WebUrl = &v
return s
}
// Represents a sample of performance data.
// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/Sample
type Sample struct {
@ -12342,8 +12517,8 @@ func (s *UpdateDevicePoolOutput) SetDevicePool(v *DevicePool) *UpdateDevicePoolO
type UpdateNetworkProfileInput struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the project that you wish to update network
// profile settings.
// The Amazon Resource Name (ARN) of the project for which you want to update
// network profile settings.
//
// Arn is a required field
Arn *string `locationName:"arn" min:"32" type:"string" required:"true"`
@ -12954,6 +13129,17 @@ const (
ExecutionStatusStopping = "STOPPING"
)
const (
// InteractionModeInteractive is a InteractionMode enum value
InteractionModeInteractive = "INTERACTIVE"
// InteractionModeNoVideo is a InteractionMode enum value
InteractionModeNoVideo = "NO_VIDEO"
// InteractionModeVideoOnly is a InteractionMode enum value
InteractionModeVideoOnly = "VIDEO_ONLY"
)
const (
// NetworkProfileTypeCurated is a NetworkProfileType enum value
NetworkProfileTypeCurated = "CURATED"
@ -13063,6 +13249,9 @@ const (
// TestTypeBuiltinExplorer is a TestType enum value
TestTypeBuiltinExplorer = "BUILTIN_EXPLORER"
// TestTypeWebPerformanceProfile is a TestType enum value
TestTypeWebPerformanceProfile = "WEB_PERFORMANCE_PROFILE"
// TestTypeAppiumJavaJunit is a TestType enum value
TestTypeAppiumJavaJunit = "APPIUM_JAVA_JUNIT"
@ -13098,6 +13287,12 @@ const (
// TestTypeXctestUi is a TestType enum value
TestTypeXctestUi = "XCTEST_UI"
// TestTypeRemoteAccessRecord is a TestType enum value
TestTypeRemoteAccessRecord = "REMOTE_ACCESS_RECORD"
// TestTypeRemoteAccessReplay is a TestType enum value
TestTypeRemoteAccessReplay = "REMOTE_ACCESS_REPLAY"
)
const (

View File

@ -3475,6 +3475,59 @@ func (s AcceptInvitationOutput) GoString() string {
return s.String()
}
// The IAM access key details (IAM user information) of a user that engaged
// in the activity that prompted GuardDuty to generate a finding.
// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/AccessKeyDetails
type AccessKeyDetails struct {
_ struct{} `type:"structure"`
// Access key ID of the user.
AccessKeyId *string `locationName:"accessKeyId" type:"string"`
// The principal ID of the user.
PrincipalId *string `locationName:"principalId" type:"string"`
// The name of the user.
UserName *string `locationName:"userName" type:"string"`
// The type of the user.
UserType *string `locationName:"userType" type:"string"`
}
// String returns the string representation
func (s AccessKeyDetails) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s AccessKeyDetails) GoString() string {
return s.String()
}
// SetAccessKeyId sets the AccessKeyId field's value.
func (s *AccessKeyDetails) SetAccessKeyId(v string) *AccessKeyDetails {
s.AccessKeyId = &v
return s
}
// SetPrincipalId sets the PrincipalId field's value.
func (s *AccessKeyDetails) SetPrincipalId(v string) *AccessKeyDetails {
s.PrincipalId = &v
return s
}
// SetUserName sets the UserName field's value.
func (s *AccessKeyDetails) SetUserName(v string) *AccessKeyDetails {
s.UserName = &v
return s
}
// SetUserType sets the UserType field's value.
func (s *AccessKeyDetails) SetUserType(v string) *AccessKeyDetails {
s.UserType = &v
return s
}
// An object containing the member's accountId and email address.
// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/AccountDetail
type AccountDetail struct {
@ -7028,6 +7081,10 @@ func (s *RemotePortDetails) SetPortName(v string) *RemotePortDetails {
type Resource struct {
_ struct{} `type:"structure"`
// The IAM access key details (IAM user information) of a user that engaged
// in the activity that prompted GuardDuty to generate a finding.
AccessKeyDetails *AccessKeyDetails `locationName:"accessKeyDetails" type:"structure"`
// The information about the EC2 instance associated with the activity that
// prompted GuardDuty to generate a finding.
InstanceDetails *InstanceDetails `locationName:"instanceDetails" type:"structure"`
@ -7046,6 +7103,12 @@ func (s Resource) GoString() string {
return s.String()
}
// SetAccessKeyDetails sets the AccessKeyDetails field's value.
func (s *Resource) SetAccessKeyDetails(v *AccessKeyDetails) *Resource {
s.AccessKeyDetails = v
return s
}
// SetInstanceDetails sets the InstanceDetails field's value.
func (s *Resource) SetInstanceDetails(v *InstanceDetails) *Resource {
s.InstanceDetails = v

View File

@ -101,6 +101,11 @@ func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) (req *request.R
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
// * ErrCodePreconditionFailedException "PreconditionFailedException"
// The RevisionId provided does not match the latest RevisionId for the Lambda
// function or alias. Call the GetFunction or the GetAlias API to retrieve the
// latest RevisionId for your resource.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/AddPermission
func (c *Lambda) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) {
req, out := c.AddPermissionRequest(input)
@ -2326,6 +2331,11 @@ func (c *Lambda) PublishVersionRequest(input *PublishVersionInput) (req *request
// * ErrCodeCodeStorageExceededException "CodeStorageExceededException"
// You have exceeded your maximum total code size per account. Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html)
//
// * ErrCodePreconditionFailedException "PreconditionFailedException"
// The RevisionId provided does not match the latest RevisionId for the Lambda
// function or alias. Call the GetFunction or the GetAlias API to retrieve the
// latest RevisionId for your resource.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/PublishVersion
func (c *Lambda) PublishVersion(input *PublishVersionInput) (*FunctionConfiguration, error) {
req, out := c.PublishVersionRequest(input)
@ -2525,6 +2535,11 @@ func (c *Lambda) RemovePermissionRequest(input *RemovePermissionInput) (req *req
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
// * ErrCodePreconditionFailedException "PreconditionFailedException"
// The RevisionId provided does not match the latest RevisionId for the Lambda
// function or alias. Call the GetFunction or the GetAlias API to retrieve the
// latest RevisionId for your resource.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/RemovePermission
func (c *Lambda) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) {
req, out := c.RemovePermissionRequest(input)
@ -2806,6 +2821,11 @@ func (c *Lambda) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Reque
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
//
// * ErrCodePreconditionFailedException "PreconditionFailedException"
// The RevisionId provided does not match the latest RevisionId for the Lambda
// function or alias. Call the GetFunction or the GetAlias API to retrieve the
// latest RevisionId for your resource.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/UpdateAlias
func (c *Lambda) UpdateAlias(input *UpdateAliasInput) (*AliasConfiguration, error) {
req, out := c.UpdateAliasRequest(input)
@ -3016,6 +3036,11 @@ func (c *Lambda) UpdateFunctionCodeRequest(input *UpdateFunctionCodeInput) (req
// * ErrCodeCodeStorageExceededException "CodeStorageExceededException"
// You have exceeded your maximum total code size per account. Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html)
//
// * ErrCodePreconditionFailedException "PreconditionFailedException"
// The RevisionId provided does not match the latest RevisionId for the Lambda
// function or alias. Call the GetFunction or the GetAlias API to retrieve the
// latest RevisionId for your resource.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/UpdateFunctionCode
func (c *Lambda) UpdateFunctionCode(input *UpdateFunctionCodeInput) (*FunctionConfiguration, error) {
req, out := c.UpdateFunctionCodeRequest(input)
@ -3119,6 +3144,11 @@ func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigu
// * ErrCodeResourceConflictException "ResourceConflictException"
// The resource already exists.
//
// * ErrCodePreconditionFailedException "PreconditionFailedException"
// The RevisionId provided does not match the latest RevisionId for the Lambda
// function or alias. Call the GetFunction or the GetAlias API to retrieve the
// latest RevisionId for your resource.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/UpdateFunctionConfiguration
func (c *Lambda) UpdateFunctionConfiguration(input *UpdateFunctionConfigurationInput) (*FunctionConfiguration, error) {
req, out := c.UpdateFunctionConfigurationRequest(input)
@ -3303,6 +3333,13 @@ type AddPermissionInput struct {
// arn:aws:lambda:aws-region:acct-id:function:function-name
Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"`
// An optional value you can use to ensure you are updating the latest update
// of the function version or alias. If the RevisionID you pass doesn't match
// the latest RevisionId of the function or alias, it will fail with an error
// message, advising you to retrieve the latest function version or alias RevisionID
// using either or .
RevisionId *string `type:"string"`
// This parameter is used for S3 and SES. The AWS account ID (without a hyphen)
// of the source owner. For example, if the SourceArn identifies a bucket, then
// this is the bucket owner's account ID. You can use this additional condition
@ -3399,6 +3436,12 @@ func (s *AddPermissionInput) SetQualifier(v string) *AddPermissionInput {
return s
}
// SetRevisionId sets the RevisionId field's value.
func (s *AddPermissionInput) SetRevisionId(v string) *AddPermissionInput {
s.RevisionId = &v
return s
}
// SetSourceAccount sets the SourceAccount field's value.
func (s *AddPermissionInput) SetSourceAccount(v string) *AddPermissionInput {
s.SourceAccount = &v
@ -3462,6 +3505,9 @@ type AliasConfiguration struct {
// Alias name.
Name *string `min:"1" type:"string"`
// Represents the latest updated revision of the function or alias.
RevisionId *string `type:"string"`
// Specifies an additional function versions the alias points to, allowing you
// to dictate what percentage of traffic will invoke each version. For more
// information, see lambda-traffic-shifting-using-aliases.
@ -3502,6 +3548,12 @@ func (s *AliasConfiguration) SetName(v string) *AliasConfiguration {
return s
}
// SetRevisionId sets the RevisionId field's value.
func (s *AliasConfiguration) SetRevisionId(v string) *AliasConfiguration {
s.RevisionId = &v
return s
}
// SetRoutingConfig sets the RoutingConfig field's value.
func (s *AliasConfiguration) SetRoutingConfig(v *AliasRoutingConfiguration) *AliasConfiguration {
s.RoutingConfig = v
@ -3833,7 +3885,7 @@ type CreateFunctionInput struct {
// Node v0.10.42 is currently marked as deprecated. You must migrate existing
// functions to the newer Node.js runtime versions available on AWS Lambda (nodejs4.3
// or nodejs6.10) as soon as possible. Failure to do so will result in an invalid
// parmaeter error being returned. Note that you will have to follow this procedure
// parameter error being returned. Note that you will have to follow this procedure
// for each region that contains functions written in the Node v0.10.42 runtime.
//
// Runtime is a required field
@ -4642,6 +4694,9 @@ type FunctionConfiguration struct {
// of 64 MB.
MemorySize *int64 `min:"128" type:"integer"`
// Represents the latest updated revision of the function or alias.
RevisionId *string `type:"string"`
// The Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it
// executes your function to access any other Amazon Web Services (AWS) resources.
Role *string `type:"string"`
@ -4746,6 +4801,12 @@ func (s *FunctionConfiguration) SetMemorySize(v int64) *FunctionConfiguration {
return s
}
// SetRevisionId sets the RevisionId field's value.
func (s *FunctionConfiguration) SetRevisionId(v string) *FunctionConfiguration {
s.RevisionId = &v
return s
}
// SetRole sets the Role field's value.
func (s *FunctionConfiguration) SetRole(v string) *FunctionConfiguration {
s.Role = &v
@ -5195,6 +5256,9 @@ type GetPolicyOutput struct {
// returns the same as a string using a backslash ("\") as an escape character
// in the JSON.
Policy *string `type:"string"`
// Represents the latest updated revision of the function or alias.
RevisionId *string `type:"string"`
}
// String returns the string representation
@ -5213,6 +5277,12 @@ func (s *GetPolicyOutput) SetPolicy(v string) *GetPolicyOutput {
return s
}
// SetRevisionId sets the RevisionId field's value.
func (s *GetPolicyOutput) SetRevisionId(v string) *GetPolicyOutput {
s.RevisionId = &v
return s
}
// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/InvokeAsyncRequest
type InvokeAsyncInput struct {
_ struct{} `deprecated:"true" type:"structure" payload:"InvokeArgs"`
@ -6025,6 +6095,13 @@ type PublishVersionInput struct {
//
// FunctionName is a required field
FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"`
// An optional value you can use to ensure you are updating the latest update
// of the function version or alias. If the RevisionID you pass doesn't match
// the latest RevisionId of the function or alias, it will fail with an error
// message, advising you to retrieve the latest function version or alias RevisionID
// using either or .
RevisionId *string `type:"string"`
}
// String returns the string representation
@ -6071,6 +6148,12 @@ func (s *PublishVersionInput) SetFunctionName(v string) *PublishVersionInput {
return s
}
// SetRevisionId sets the RevisionId field's value.
func (s *PublishVersionInput) SetRevisionId(v string) *PublishVersionInput {
s.RevisionId = &v
return s
}
// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/PutFunctionConcurrencyRequest
type PutFunctionConcurrencyInput struct {
_ struct{} `type:"structure"`
@ -6175,6 +6258,13 @@ type RemovePermissionInput struct {
// ARN.
Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"`
// An optional value you can use to ensure you are updating the latest update
// of the function version or alias. If the RevisionID you pass doesn't match
// the latest RevisionId of the function or alias, it will fail with an error
// message, advising you to retrieve the latest function version or alias RevisionID
// using either or .
RevisionId *string `location:"querystring" locationName:"RevisionId" type:"string"`
// Statement ID of the permission to remove.
//
// StatementId is a required field
@ -6228,6 +6318,12 @@ func (s *RemovePermissionInput) SetQualifier(v string) *RemovePermissionInput {
return s
}
// SetRevisionId sets the RevisionId field's value.
func (s *RemovePermissionInput) SetRevisionId(v string) *RemovePermissionInput {
s.RevisionId = &v
return s
}
// SetStatementId sets the StatementId field's value.
func (s *RemovePermissionInput) SetStatementId(v string) *RemovePermissionInput {
s.StatementId = &v
@ -6462,6 +6558,13 @@ type UpdateAliasInput struct {
// Name is a required field
Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"`
// An optional value you can use to ensure you are updating the latest update
// of the function version or alias. If the RevisionID you pass doesn't match
// the latest RevisionId of the function or alias, it will fail with an error
// message, advising you to retrieve the latest function version or alias RevisionID
// using either or .
RevisionId *string `type:"string"`
// Specifies an additional version your alias can point to, allowing you to
// dictate what percentage of traffic will invoke each version. For more information,
// see lambda-traffic-shifting-using-aliases.
@ -6527,6 +6630,12 @@ func (s *UpdateAliasInput) SetName(v string) *UpdateAliasInput {
return s
}
// SetRevisionId sets the RevisionId field's value.
func (s *UpdateAliasInput) SetRevisionId(v string) *UpdateAliasInput {
s.RevisionId = &v
return s
}
// SetRoutingConfig sets the RoutingConfig field's value.
func (s *UpdateAliasInput) SetRoutingConfig(v *AliasRoutingConfiguration) *UpdateAliasInput {
s.RoutingConfig = v
@ -6648,6 +6757,13 @@ type UpdateFunctionCodeInput struct {
// function and publish a version as an atomic operation.
Publish *bool `type:"boolean"`
// An optional value you can use to ensure you are updating the latest update
// of the function version or alias. If the RevisionID you pass doesn't match
// the latest RevisionId of the function or alias, it will fail with an error
// message, advising you to retrieve the latest function version or alias RevisionID
// using either or .
RevisionId *string `type:"string"`
// Amazon S3 bucket name where the .zip file containing your deployment package
// is stored. This bucket must reside in the same AWS Region where you are creating
// the Lambda function.
@ -6723,6 +6839,12 @@ func (s *UpdateFunctionCodeInput) SetPublish(v bool) *UpdateFunctionCodeInput {
return s
}
// SetRevisionId sets the RevisionId field's value.
func (s *UpdateFunctionCodeInput) SetRevisionId(v string) *UpdateFunctionCodeInput {
s.RevisionId = &v
return s
}
// SetS3Bucket sets the S3Bucket field's value.
func (s *UpdateFunctionCodeInput) SetS3Bucket(v string) *UpdateFunctionCodeInput {
s.S3Bucket = &v
@ -6790,6 +6912,13 @@ type UpdateFunctionConfigurationInput struct {
// MB.
MemorySize *int64 `min:"128" type:"integer"`
// An optional value you can use to ensure you are updating the latest update
// of the function version or alias. If the RevisionID you pass doesn't match
// the latest RevisionId of the function or alias, it will fail with an error
// message, advising you to retrieve the latest function version or alias RevisionID
// using either or .
RevisionId *string `type:"string"`
// The Amazon Resource Name (ARN) of the IAM role that Lambda will assume when
// it executes your function.
Role *string `type:"string"`
@ -6898,6 +7027,12 @@ func (s *UpdateFunctionConfigurationInput) SetMemorySize(v int64) *UpdateFunctio
return s
}
// SetRevisionId sets the RevisionId field's value.
func (s *UpdateFunctionConfigurationInput) SetRevisionId(v string) *UpdateFunctionConfigurationInput {
s.RevisionId = &v
return s
}
// SetRole sets the Role field's value.
func (s *UpdateFunctionConfigurationInput) SetRole(v string) *UpdateFunctionConfigurationInput {
s.Role = &v

View File

@ -109,6 +109,14 @@ const (
// Lambda function access policy is limited to 20 KB.
ErrCodePolicyLengthExceededException = "PolicyLengthExceededException"
// ErrCodePreconditionFailedException for service response error code
// "PreconditionFailedException".
//
// The RevisionId provided does not match the latest RevisionId for the Lambda
// function or alias. Call the GetFunction or the GetAlias API to retrieve the
// latest RevisionId for your resource.
ErrCodePreconditionFailedException = "PreconditionFailedException"
// ErrCodeRequestTooLargeException for service response error code
// "RequestTooLargeException".
//

View File

@ -1,34 +1,37 @@
## 1.8.0 (Unreleased)
## 1.8.0 (January 29, 2018)
FEATURES:
* **New Resource:** `aws_dynamodb_global_table` [GH-2517]
* **New Resource:** `aws_gamelift_build` [GH-2843]
* **New Resource:** `aws_dynamodb_global_table` ([#2517](https://github.com/terraform-providers/terraform-provider-aws/issues/2517))
* **New Resource:** `aws_gamelift_build` ([#2843](https://github.com/terraform-providers/terraform-provider-aws/issues/2843))
ENHANCEMENTS:
* data-source/aws_kms_alias: Add target_key_arn attribute [GH-2551]
* resource/aws_api_gateway_integration: Allow update of content_handling attributes [GH-3123]
* resource/aws_appautoscaling_target: Support updating max_capacity, min_capacity, and role_arn attributes [GH-2950]
* resource/aws_cloudwatch_log_subscription_filter: Add support for distribution [GH-3046]
* resource/aws_cognito_user_pool: support pre_token_generation in lambda_config [GH-3093]
* resource/aws_elasticsearch_domain: Add support for encrypt_at_rest [GH-2632]
* resource/aws_emr_cluster: Support CustomAmiId [GH-2766]
* resource/aws_kms_alias: Add target_key_arn attribute [GH-3096]
* resource/aws_route: Allow adding IPv6 routes to instances and network interfaces [GH-2265]
* resource/aws_sqs_queue: Retry queue creation on QueueDeletedRecently error [GH-3113]
* resource/aws_vpn_connection: Add inside CIDR and pre-shared key attributes [GH-1862]
* provider: `cn-northwest-1` region is now supported ([#3142](https://github.com/terraform-providers/terraform-provider-aws/issues/3142))
* data-source/aws_kms_alias: Add target_key_arn attribute ([#2551](https://github.com/terraform-providers/terraform-provider-aws/issues/2551))
* resource/aws_api_gateway_integration: Allow update of content_handling attributes ([#3123](https://github.com/terraform-providers/terraform-provider-aws/issues/3123))
* resource/aws_appautoscaling_target: Support updating max_capacity, min_capacity, and role_arn attributes ([#2950](https://github.com/terraform-providers/terraform-provider-aws/issues/2950))
* resource/aws_cloudwatch_log_subscription_filter: Add support for distribution ([#3046](https://github.com/terraform-providers/terraform-provider-aws/issues/3046))
* resource/aws_cognito_user_pool: support pre_token_generation in lambda_config ([#3093](https://github.com/terraform-providers/terraform-provider-aws/issues/3093))
* resource/aws_elasticsearch_domain: Add support for encrypt_at_rest ([#2632](https://github.com/terraform-providers/terraform-provider-aws/issues/2632))
* resource/aws_emr_cluster: Support CustomAmiId ([#2766](https://github.com/terraform-providers/terraform-provider-aws/issues/2766))
* resource/aws_kms_alias: Add target_key_arn attribute ([#3096](https://github.com/terraform-providers/terraform-provider-aws/issues/3096))
* resource/aws_route: Allow adding IPv6 routes to instances and network interfaces ([#2265](https://github.com/terraform-providers/terraform-provider-aws/issues/2265))
* resource/aws_sqs_queue: Retry queue creation on QueueDeletedRecently error ([#3113](https://github.com/terraform-providers/terraform-provider-aws/issues/3113))
* resource/aws_vpn_connection: Add inside CIDR and pre-shared key attributes ([#1862](https://github.com/terraform-providers/terraform-provider-aws/issues/1862))
BUG FIXES:
* resource/aws_appautoscaling_policy: Support additional predefined metric types in validation [GH-3122]
* resource/aws_ebs_snapshot: Fix `kms_key_id` attribute handling [GH-3085]
* resource/aws_eip_assocation: Retry association for pending instances [GH-3072]
* resource/aws_kinesis_firehose_delivery_stream: Prevent panic on missing S3 configuration prefix [GH-3073]
* resource/aws_lambda_function: Retry updates for IAM eventual consistency [GH-3116]
* resource/aws_route53_record: Suppress uppercase alias name diff [GH-3119]
* resource/aws_sqs_queue_policy: Prevent missing policy error on read [GH-2739]
* resource/aws_rds_cluster: Retry deletion on InvalidDBClusterStateFault [GH-3028]
* resource/aws_appautoscaling_policy: Support additional predefined metric types in validation [[#3122](https://github.com/terraform-providers/terraform-provider-aws/issues/3122)]]
* resource/aws_dynamodb_table: Recognize changes in `non_key_attributes` ([#3136](https://github.com/terraform-providers/terraform-provider-aws/issues/3136))
* resource/aws_ebs_snapshot: Fix `kms_key_id` attribute handling ([#3085](https://github.com/terraform-providers/terraform-provider-aws/issues/3085))
* resource/aws_eip_assocation: Retry association for pending instances ([#3072](https://github.com/terraform-providers/terraform-provider-aws/issues/3072))
* resource/aws_elastic_beanstalk_application: Prevent crash on reading missing application ([#3171](https://github.com/terraform-providers/terraform-provider-aws/issues/3171))
* resource/aws_kinesis_firehose_delivery_stream: Prevent panic on missing S3 configuration prefix ([#3073](https://github.com/terraform-providers/terraform-provider-aws/issues/3073))
* resource/aws_lambda_function: Retry updates for IAM eventual consistency ([#3116](https://github.com/terraform-providers/terraform-provider-aws/issues/3116))
* resource/aws_route53_record: Suppress uppercase alias name diff ([#3119](https://github.com/terraform-providers/terraform-provider-aws/issues/3119))
* resource/aws_sqs_queue_policy: Prevent missing policy error on read ([#2739](https://github.com/terraform-providers/terraform-provider-aws/issues/2739))
* resource/aws_rds_cluster: Retry deletion on InvalidDBClusterStateFault ([#3028](https://github.com/terraform-providers/terraform-provider-aws/issues/3028))
## 1.7.1 (January 19, 2018)

View File

@ -3,12 +3,10 @@ package aws
import (
"bytes"
"fmt"
"log"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/terraform/helper/hashcode"
"github.com/hashicorp/terraform/helper/schema"
)
@ -174,21 +172,41 @@ func dataSourceAwsDynamoDbTable() *schema.Resource {
}
func dataSourceAwsDynamoDbTableRead(d *schema.ResourceData, meta interface{}) error {
dynamodbconn := meta.(*AWSClient).dynamodbconn
conn := meta.(*AWSClient).dynamodbconn
name := d.Get("name").(string)
req := &dynamodb.DescribeTableInput{
TableName: aws.String(name),
}
log.Printf("[DEBUG] Reading DynamoDB Table: %s", req)
result, err := dynamodbconn.DescribeTable(req)
result, err := conn.DescribeTable(&dynamodb.DescribeTableInput{
TableName: aws.String(d.Get("name").(string)),
})
if err != nil {
return errwrap.Wrapf("Error retrieving DynamoDB table: {{err}}", err)
return fmt.Errorf("Error retrieving DynamoDB table: %s", err)
}
d.SetId(*result.Table.TableName)
return flattenAwsDynamoDbTableResource(d, meta, result.Table)
err = flattenAwsDynamoDbTableResource(d, result.Table)
if err != nil {
return err
}
ttlOut, err := conn.DescribeTimeToLive(&dynamodb.DescribeTimeToLiveInput{
TableName: aws.String(d.Id()),
})
if err != nil {
return err
}
if ttlOut.TimeToLiveDescription != nil {
err := d.Set("ttl", flattenDynamoDbTtl(ttlOut.TimeToLiveDescription))
if err != nil {
return err
}
}
tags, err := readDynamoDbTableTags(d.Get("arn").(string), conn)
if err != nil {
return err
}
d.Set("tags", tags)
return nil
}

View File

@ -99,14 +99,20 @@ func resourceAwsElasticBeanstalkApplicationRead(d *schema.ResourceData, meta int
}
if app == nil {
err = fmt.Errorf("Elastic Beanstalk Application %q not found", d.Id())
if d.IsNewResource() {
return resource.RetryableError(fmt.Errorf("Elastic Beanstalk Application %q not found.", d.Id()))
return resource.RetryableError(err)
}
return resource.NonRetryableError(err)
}
return nil
})
if err != nil {
if app == nil {
log.Printf("[WARN] %s, removing from state", err)
d.SetId("")
return nil
}
return err
}

View File

@ -19,6 +19,7 @@ import (
"github.com/aws/aws-sdk-go/service/cognitoidentityprovider"
"github.com/aws/aws-sdk-go/service/configservice"
"github.com/aws/aws-sdk-go/service/directoryservice"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/aws/aws-sdk-go/service/elasticache"
@ -36,6 +37,7 @@ import (
"github.com/beevik/etree"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/structure"
"github.com/mitchellh/copystructure"
"gopkg.in/yaml.v2"
)
@ -3074,3 +3076,310 @@ func flattenMqBrokerInstances(instances []*mq.BrokerInstance) []interface{} {
return l
}
func diffDynamoDbGSI(oldGsi, newGsi []interface{}) (ops []*dynamodb.GlobalSecondaryIndexUpdate, e error) {
// Transform slices into maps
oldGsis := make(map[string]interface{})
for _, gsidata := range oldGsi {
m := gsidata.(map[string]interface{})
oldGsis[m["name"].(string)] = m
}
newGsis := make(map[string]interface{})
for _, gsidata := range newGsi {
m := gsidata.(map[string]interface{})
newGsis[m["name"].(string)] = m
}
for _, data := range newGsi {
newMap := data.(map[string]interface{})
newName := newMap["name"].(string)
if _, exists := oldGsis[newName]; !exists {
m := data.(map[string]interface{})
idxName := m["name"].(string)
ops = append(ops, &dynamodb.GlobalSecondaryIndexUpdate{
Create: &dynamodb.CreateGlobalSecondaryIndexAction{
IndexName: aws.String(idxName),
KeySchema: expandDynamoDbKeySchema(m),
ProvisionedThroughput: expandDynamoDbProvisionedThroughput(m),
Projection: expandDynamoDbProjection(m),
},
})
}
}
for _, data := range oldGsi {
oldMap := data.(map[string]interface{})
oldName := oldMap["name"].(string)
newData, exists := newGsis[oldName]
if exists {
newMap := newData.(map[string]interface{})
idxName := newMap["name"].(string)
oldWriteCapacity, oldReadCapacity := oldMap["write_capacity"].(int), oldMap["read_capacity"].(int)
newWriteCapacity, newReadCapacity := newMap["write_capacity"].(int), newMap["read_capacity"].(int)
capacityChanged := (oldWriteCapacity != newWriteCapacity || oldReadCapacity != newReadCapacity)
oldAttributes, err := stripCapacityAttributes(oldMap)
if err != nil {
e = err
return
}
newAttributes, err := stripCapacityAttributes(newMap)
if err != nil {
e = err
return
}
otherAttributesChanged := !reflect.DeepEqual(oldAttributes, newAttributes)
if capacityChanged && !otherAttributesChanged {
update := &dynamodb.GlobalSecondaryIndexUpdate{
Update: &dynamodb.UpdateGlobalSecondaryIndexAction{
IndexName: aws.String(idxName),
ProvisionedThroughput: expandDynamoDbProvisionedThroughput(newMap),
},
}
ops = append(ops, update)
} else if otherAttributesChanged {
// Other attributes cannot be updated
ops = append(ops, &dynamodb.GlobalSecondaryIndexUpdate{
Delete: &dynamodb.DeleteGlobalSecondaryIndexAction{
IndexName: aws.String(idxName),
},
})
ops = append(ops, &dynamodb.GlobalSecondaryIndexUpdate{
Create: &dynamodb.CreateGlobalSecondaryIndexAction{
IndexName: aws.String(idxName),
KeySchema: expandDynamoDbKeySchema(newMap),
ProvisionedThroughput: expandDynamoDbProvisionedThroughput(newMap),
Projection: expandDynamoDbProjection(newMap),
},
})
}
} else {
idxName := oldName
ops = append(ops, &dynamodb.GlobalSecondaryIndexUpdate{
Delete: &dynamodb.DeleteGlobalSecondaryIndexAction{
IndexName: aws.String(idxName),
},
})
}
}
return
}
func stripCapacityAttributes(in map[string]interface{}) (map[string]interface{}, error) {
mapCopy, err := copystructure.Copy(in)
if err != nil {
return nil, err
}
m := mapCopy.(map[string]interface{})
delete(m, "write_capacity")
delete(m, "read_capacity")
return m, nil
}
// Expanders + flatteners
func flattenDynamoDbTtl(ttlDesc *dynamodb.TimeToLiveDescription) []interface{} {
m := map[string]interface{}{}
if ttlDesc.AttributeName != nil {
m["attribute_name"] = *ttlDesc.AttributeName
if ttlDesc.TimeToLiveStatus != nil {
m["enabled"] = (*ttlDesc.TimeToLiveStatus == dynamodb.TimeToLiveStatusEnabled)
}
}
if len(m) > 0 {
return []interface{}{m}
}
return []interface{}{}
}
func flattenAwsDynamoDbTableResource(d *schema.ResourceData, table *dynamodb.TableDescription) error {
d.Set("write_capacity", table.ProvisionedThroughput.WriteCapacityUnits)
d.Set("read_capacity", table.ProvisionedThroughput.ReadCapacityUnits)
attributes := []interface{}{}
for _, attrdef := range table.AttributeDefinitions {
attribute := map[string]string{
"name": *attrdef.AttributeName,
"type": *attrdef.AttributeType,
}
attributes = append(attributes, attribute)
}
d.Set("attribute", attributes)
d.Set("name", table.TableName)
for _, attribute := range table.KeySchema {
if *attribute.KeyType == dynamodb.KeyTypeHash {
d.Set("hash_key", attribute.AttributeName)
}
if *attribute.KeyType == dynamodb.KeyTypeRange {
d.Set("range_key", attribute.AttributeName)
}
}
lsiList := make([]map[string]interface{}, 0, len(table.LocalSecondaryIndexes))
for _, lsiObject := range table.LocalSecondaryIndexes {
lsi := map[string]interface{}{
"name": *lsiObject.IndexName,
"projection_type": *lsiObject.Projection.ProjectionType,
}
for _, attribute := range lsiObject.KeySchema {
if *attribute.KeyType == dynamodb.KeyTypeRange {
lsi["range_key"] = *attribute.AttributeName
}
}
nkaList := make([]string, len(lsiObject.Projection.NonKeyAttributes))
for _, nka := range lsiObject.Projection.NonKeyAttributes {
nkaList = append(nkaList, *nka)
}
lsi["non_key_attributes"] = nkaList
lsiList = append(lsiList, lsi)
}
err := d.Set("local_secondary_index", lsiList)
if err != nil {
return err
}
gsiList := make([]map[string]interface{}, 0, len(table.GlobalSecondaryIndexes))
for _, gsiObject := range table.GlobalSecondaryIndexes {
gsi := map[string]interface{}{
"write_capacity": *gsiObject.ProvisionedThroughput.WriteCapacityUnits,
"read_capacity": *gsiObject.ProvisionedThroughput.ReadCapacityUnits,
"name": *gsiObject.IndexName,
}
for _, attribute := range gsiObject.KeySchema {
if *attribute.KeyType == dynamodb.KeyTypeHash {
gsi["hash_key"] = *attribute.AttributeName
}
if *attribute.KeyType == dynamodb.KeyTypeRange {
gsi["range_key"] = *attribute.AttributeName
}
}
gsi["projection_type"] = *(gsiObject.Projection.ProjectionType)
nonKeyAttrs := make([]string, 0, len(gsiObject.Projection.NonKeyAttributes))
for _, nonKeyAttr := range gsiObject.Projection.NonKeyAttributes {
nonKeyAttrs = append(nonKeyAttrs, *nonKeyAttr)
}
gsi["non_key_attributes"] = nonKeyAttrs
gsiList = append(gsiList, gsi)
}
if table.StreamSpecification != nil {
d.Set("stream_view_type", table.StreamSpecification.StreamViewType)
d.Set("stream_enabled", table.StreamSpecification.StreamEnabled)
d.Set("stream_arn", table.LatestStreamArn)
d.Set("stream_label", table.LatestStreamLabel)
}
err = d.Set("global_secondary_index", gsiList)
if err != nil {
return err
}
d.Set("arn", table.TableArn)
return nil
}
func expandDynamoDbAttributes(cfg []interface{}) []*dynamodb.AttributeDefinition {
attributes := make([]*dynamodb.AttributeDefinition, len(cfg), len(cfg))
for i, attribute := range cfg {
attr := attribute.(map[string]interface{})
attributes[i] = &dynamodb.AttributeDefinition{
AttributeName: aws.String(attr["name"].(string)),
AttributeType: aws.String(attr["type"].(string)),
}
}
return attributes
}
// TODO: Get rid of keySchemaM - the user should just explicitely define
// this in the config, we shouldn't magically be setting it like this.
// Removal will however require config change, hence BC. :/
func expandDynamoDbLocalSecondaryIndexes(cfg []interface{}, keySchemaM map[string]interface{}) []*dynamodb.LocalSecondaryIndex {
indexes := make([]*dynamodb.LocalSecondaryIndex, len(cfg), len(cfg))
for i, lsi := range cfg {
m := lsi.(map[string]interface{})
idxName := m["name"].(string)
// TODO: See https://github.com/terraform-providers/terraform-provider-aws/issues/3176
if _, ok := m["hash_key"]; !ok {
m["hash_key"] = keySchemaM["hash_key"]
}
indexes[i] = &dynamodb.LocalSecondaryIndex{
IndexName: aws.String(idxName),
KeySchema: expandDynamoDbKeySchema(m),
Projection: expandDynamoDbProjection(m),
}
}
return indexes
}
func expandDynamoDbGlobalSecondaryIndex(data map[string]interface{}) *dynamodb.GlobalSecondaryIndex {
return &dynamodb.GlobalSecondaryIndex{
IndexName: aws.String(data["name"].(string)),
KeySchema: expandDynamoDbKeySchema(data),
Projection: expandDynamoDbProjection(data),
ProvisionedThroughput: expandDynamoDbProvisionedThroughput(data),
}
}
func expandDynamoDbProvisionedThroughput(data map[string]interface{}) *dynamodb.ProvisionedThroughput {
return &dynamodb.ProvisionedThroughput{
WriteCapacityUnits: aws.Int64(int64(data["write_capacity"].(int))),
ReadCapacityUnits: aws.Int64(int64(data["read_capacity"].(int))),
}
}
func expandDynamoDbProjection(data map[string]interface{}) *dynamodb.Projection {
projection := &dynamodb.Projection{
ProjectionType: aws.String(data["projection_type"].(string)),
}
if v, ok := data["non_key_attributes"].([]interface{}); ok && len(v) > 0 {
projection.NonKeyAttributes = expandStringList(v)
}
return projection
}
func expandDynamoDbKeySchema(data map[string]interface{}) []*dynamodb.KeySchemaElement {
keySchema := []*dynamodb.KeySchemaElement{}
if v, ok := data["hash_key"]; ok && v != nil && v != "" {
keySchema = append(keySchema, &dynamodb.KeySchemaElement{
AttributeName: aws.String(v.(string)),
KeyType: aws.String(dynamodb.KeyTypeHash),
})
}
if v, ok := data["range_key"]; ok && v != nil && v != "" {
keySchema = append(keySchema, &dynamodb.KeySchemaElement{
AttributeName: aws.String(v.(string)),
KeyType: aws.String(dynamodb.KeyTypeRange),
})
}
return keySchema
}

View File

@ -333,53 +333,49 @@ func tagsFromMapDynamoDb(m map[string]interface{}) []*dynamodb.Tag {
// method from the ec2 tag resource handling. Also the `UntagResource` method
// for dynamoDB only requires a list of tag keys, instead of the full map of keys.
func setTagsDynamoDb(conn *dynamodb.DynamoDB, d *schema.ResourceData) error {
if d.HasChange("tags") {
arn := d.Get("arn").(string)
oraw, nraw := d.GetChange("tags")
o := oraw.(map[string]interface{})
n := nraw.(map[string]interface{})
create, remove := diffTagsDynamoDb(tagsFromMapDynamoDb(o), tagsFromMapDynamoDb(n))
arn := d.Get("arn").(string)
oraw, nraw := d.GetChange("tags")
o := oraw.(map[string]interface{})
n := nraw.(map[string]interface{})
create, remove := diffTagsDynamoDb(tagsFromMapDynamoDb(o), tagsFromMapDynamoDb(n))
// Set tags
if len(remove) > 0 {
err := resource.Retry(2*time.Minute, func() *resource.RetryError {
log.Printf("[DEBUG] Removing tags: %#v from %s", remove, d.Id())
_, err := conn.UntagResource(&dynamodb.UntagResourceInput{
ResourceArn: aws.String(arn),
TagKeys: remove,
})
if err != nil {
ec2err, ok := err.(awserr.Error)
if ok && strings.Contains(ec2err.Code(), "ResourceNotFoundException") {
return resource.RetryableError(err) // retry
}
return resource.NonRetryableError(err)
}
return nil
// Set tags
if len(remove) > 0 {
err := resource.Retry(2*time.Minute, func() *resource.RetryError {
log.Printf("[DEBUG] Removing tags: %#v from %s", remove, d.Id())
_, err := conn.UntagResource(&dynamodb.UntagResourceInput{
ResourceArn: aws.String(arn),
TagKeys: remove,
})
if err != nil {
return err
if isAWSErr(err, dynamodb.ErrCodeResourceNotFoundException, "") {
return resource.RetryableError(err)
}
return resource.NonRetryableError(err)
}
return nil
})
if err != nil {
return err
}
if len(create) > 0 {
err := resource.Retry(2*time.Minute, func() *resource.RetryError {
log.Printf("[DEBUG] Creating tags: %s for %s", create, d.Id())
_, err := conn.TagResource(&dynamodb.TagResourceInput{
ResourceArn: aws.String(arn),
Tags: create,
})
if err != nil {
ec2err, ok := err.(awserr.Error)
if ok && strings.Contains(ec2err.Code(), "ResourceNotFoundException") {
return resource.RetryableError(err) // retry
}
return resource.NonRetryableError(err)
}
return nil
}
if len(create) > 0 {
err := resource.Retry(2*time.Minute, func() *resource.RetryError {
log.Printf("[DEBUG] Creating tags: %s for %s", create, d.Id())
_, err := conn.TagResource(&dynamodb.TagResourceInput{
ResourceArn: aws.String(arn),
Tags: create,
})
if err != nil {
return err
if isAWSErr(err, dynamodb.ErrCodeResourceNotFoundException, "") {
return resource.RetryableError(err)
}
return resource.NonRetryableError(err)
}
return nil
})
if err != nil {
return err
}
}

782
vendor/vendor.json vendored

File diff suppressed because it is too large Load Diff