provider/aws: Forces the api gateway domain name certificates to recreate the resource (#10588)

This commit is contained in:
Ninir 2016-12-07 22:51:44 +01:00 committed by Paul Stack
parent 942cdccf2d
commit 5e3477664d
1 changed files with 3 additions and 24 deletions

View File

@ -23,11 +23,13 @@ func resourceAwsApiGatewayDomainName() *schema.Resource {
"certificate_body": {
Type: schema.TypeString,
ForceNew: true,
Required: true,
},
"certificate_chain": {
Type: schema.TypeString,
ForceNew: true,
Required: true,
},
@ -38,6 +40,7 @@ func resourceAwsApiGatewayDomainName() *schema.Resource {
"certificate_private_key": {
Type: schema.TypeString,
ForceNew: true,
Required: true,
},
@ -117,22 +120,6 @@ func resourceAwsApiGatewayDomainNameRead(d *schema.ResourceData, meta interface{
func resourceAwsApiGatewayDomainNameUpdateOperations(d *schema.ResourceData) []*apigateway.PatchOperation {
operations := make([]*apigateway.PatchOperation, 0)
if d.HasChange("certificate_body") {
operations = append(operations, &apigateway.PatchOperation{
Op: aws.String("replace"),
Path: aws.String("/certificateBody"),
Value: aws.String(d.Get("certificate_body").(string)),
})
}
if d.HasChange("certificate_chain") {
operations = append(operations, &apigateway.PatchOperation{
Op: aws.String("replace"),
Path: aws.String("/certificateChain"),
Value: aws.String(d.Get("certificate_chain").(string)),
})
}
if d.HasChange("certificate_name") {
operations = append(operations, &apigateway.PatchOperation{
Op: aws.String("replace"),
@ -141,14 +128,6 @@ func resourceAwsApiGatewayDomainNameUpdateOperations(d *schema.ResourceData) []*
})
}
if d.HasChange("certificate_private_key") {
operations = append(operations, &apigateway.PatchOperation{
Op: aws.String("replace"),
Path: aws.String("/certificatePrivateKey"),
Value: aws.String(d.Get("certificate_private_key").(string)),
})
}
return operations
}