provider/aws: Forces the api gateway domain name certificates to recreate the resource (#10588)
This commit is contained in:
parent
942cdccf2d
commit
5e3477664d
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue