-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #565 from pulumi/wjones/564
Support negative literals when generating YAML
- Loading branch information
Showing
5 changed files
with
134 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
### Improvements | ||
|
||
### Bug Fixes | ||
|
||
- Support negative literals [#565](https://github.com/pulumi/pulumi-yaml/pull/565) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
pkg/pulumiyaml/testing/test/testdata/negative-literals-pp/negative-literals.pp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
resource ecsTarget1 "aws:appautoscaling:Target" { | ||
maxCapacity = 4 | ||
minCapacity = 1 | ||
resourceId = "service/clustername/serviceName" | ||
scalableDimension = "ecs:service:DesiredCount" | ||
serviceNamespace = "ecs" | ||
} | ||
|
||
resource ecsPolicy1 "aws:appautoscaling:Policy" { | ||
name = "scale-down-integers" | ||
policyType = "StepScaling" | ||
resourceId = ecsTarget1.resourceId | ||
scalableDimension = ecsTarget1.scalableDimension | ||
serviceNamespace = ecsTarget1.serviceNamespace | ||
|
||
stepScalingPolicyConfiguration = { | ||
adjustmentType = "ChangeInCapacity" | ||
cooldown = 60 | ||
metricAggregationType = "Maximum" | ||
|
||
stepAdjustments = [ | ||
{ | ||
metricIntervalUpperBound = 0 | ||
scalingAdjustment = -1 | ||
} | ||
] | ||
} | ||
} | ||
|
||
resource ecsTarget2 "aws:appautoscaling:Target" { | ||
maxCapacity = 4 | ||
minCapacity = 1 | ||
resourceId = "service/clustername/serviceName" | ||
scalableDimension = "ecs:service:DesiredCount" | ||
serviceNamespace = "ecs" | ||
} | ||
|
||
resource ecsPolicy2 "aws:appautoscaling:Policy" { | ||
name = "scale-down-floats" | ||
policyType = "StepScaling" | ||
resourceId = ecsTarget2.resourceId | ||
scalableDimension = ecsTarget2.scalableDimension | ||
serviceNamespace = ecsTarget2.serviceNamespace | ||
|
||
stepScalingPolicyConfiguration = { | ||
adjustmentType = "ChangeInCapacity" | ||
cooldown = 60 | ||
metricAggregationType = "Maximum" | ||
|
||
stepAdjustments = [ | ||
{ | ||
metricIntervalUpperBound = 0 | ||
scalingAdjustment = -2.0 | ||
} | ||
] | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
pkg/pulumiyaml/testing/test/testdata/negative-literals-pp/yaml/negative-literals.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
resources: | ||
ecsTarget1: | ||
type: aws:appautoscaling:Target | ||
properties: | ||
maxCapacity: 4 | ||
minCapacity: 1 | ||
resourceId: service/clustername/serviceName | ||
scalableDimension: ecs:service:DesiredCount | ||
serviceNamespace: ecs | ||
ecsPolicy1: | ||
type: aws:appautoscaling:Policy | ||
properties: | ||
name: scale-down-integers | ||
policyType: StepScaling | ||
resourceId: ${ecsTarget1.resourceId} | ||
scalableDimension: ${ecsTarget1.scalableDimension} | ||
serviceNamespace: ${ecsTarget1.serviceNamespace} | ||
stepScalingPolicyConfiguration: | ||
adjustmentType: ChangeInCapacity | ||
cooldown: 60 | ||
metricAggregationType: Maximum | ||
stepAdjustments: | ||
- metricIntervalUpperBound: 0 | ||
scalingAdjustment: -1 | ||
ecsTarget2: | ||
type: aws:appautoscaling:Target | ||
properties: | ||
maxCapacity: 4 | ||
minCapacity: 1 | ||
resourceId: service/clustername/serviceName | ||
scalableDimension: ecs:service:DesiredCount | ||
serviceNamespace: ecs | ||
ecsPolicy2: | ||
type: aws:appautoscaling:Policy | ||
properties: | ||
name: scale-down-floats | ||
policyType: StepScaling | ||
resourceId: ${ecsTarget2.resourceId} | ||
scalableDimension: ${ecsTarget2.scalableDimension} | ||
serviceNamespace: ${ecsTarget2.serviceNamespace} | ||
stepScalingPolicyConfiguration: | ||
adjustmentType: ChangeInCapacity | ||
cooldown: 60 | ||
metricAggregationType: Maximum | ||
stepAdjustments: | ||
- metricIntervalUpperBound: 0 | ||
scalingAdjustment: -2 |