Skip to content

Commit

Permalink
aws_apigateway_stage: add deployment_id to canary_settings
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonaj committed Oct 29, 2024
1 parent c775845 commit 1c149c8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/service/apigateway/stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ func resourceStage() *schema.Resource {
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"deployment_id": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"percent_traffic": {
Type: schema.TypeFloat,
Optional: true,
Expand Down Expand Up @@ -570,6 +575,10 @@ func expandCanarySettings(tfMap map[string]interface{}, deploymentId string) *ty
DeploymentId: aws.String(deploymentId),
}

if v, ok := (tfMap["deployment_id"]).(string); ok && v != "" {
apiObject.DeploymentId = aws.String(v)
}

if v, ok := tfMap["percent_traffic"].(float64); ok {
apiObject.PercentTraffic = v
}
Expand Down Expand Up @@ -600,6 +609,7 @@ func flattenCanarySettings(canarySettings *types.CanarySettings) []interface{} {

settings["percent_traffic"] = canarySettings.PercentTraffic
settings["use_stage_cache"] = canarySettings.UseStageCache
settings["deployment_id"] = canarySettings.DeploymentId

return []interface{}{settings}
}
Expand Down

0 comments on commit 1c149c8

Please sign in to comment.