SAVINGSPLANS

CreateSavingsPlan

valid {
    input.Body.savingsPlanOfferingId == STRING
    input.Body.commitment == STRING
    input.Body.upfrontPaymentAmount == STRING
    input.Body.purchaseTime == TIMESTAMP
    input.Body.clientToken == STRING
    input.Body.tags.STRING == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DeleteQueuedSavingsPlan

valid {
    input.Body.savingsPlanId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DescribeSavingsPlanRates

enum_SavingsPlanRateFilterName := [ "region", "instanceType", "productDescription", "tenancy", "productType", "serviceCode", "usageType", "operation" ]

valid {
    input.Body.savingsPlanId == STRING
    input.Body.filters[_].name == enum_SavingsPlanRateFilterName[_]
    input.Body.filters[_].values[_] == STRING
    input.Body.nextToken == STRING
    input.Body.maxResults == INTEGER
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DescribeSavingsPlans

enum_SavingsPlanState := [ "payment-pending", "payment-failed", "active", "retired", "queued", "queued-deleted", "pending-return", "returned" ]
enum_SavingsPlansFilterName := [ "region", "ec2-instance-family", "commitment", "upfront", "term", "savings-plan-type", "payment-option", "start", "end" ]

valid {
    input.Body.savingsPlanArns[_] == STRING
    input.Body.savingsPlanIds[_] == STRING
    input.Body.nextToken == STRING
    input.Body.maxResults == INTEGER
    input.Body.states[_] == enum_SavingsPlanState[_]
    input.Body.filters[_].name == enum_SavingsPlansFilterName[_]
    input.Body.filters[_].values[_] == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DescribeSavingsPlansOfferingRates

enum_SavingsPlanPaymentOption := [ "All Upfront", "Partial Upfront", "No Upfront" ]
enum_SavingsPlanProductType := [ "EC2", "Fargate", "Lambda", "SageMaker" ]
enum_SavingsPlanRateFilterAttribute := [ "region", "instanceFamily", "instanceType", "productDescription", "tenancy", "productId" ]
enum_SavingsPlanRateServiceCode := [ "AmazonEC2", "AmazonECS", "AmazonEKS", "AWSLambda", "AmazonSageMaker" ]
enum_SavingsPlanType := [ "Compute", "EC2Instance", "SageMaker" ]

valid {
    input.Body.savingsPlanOfferingIds[_] == STRING
    input.Body.savingsPlanPaymentOptions[_] == enum_SavingsPlanPaymentOption[_]
    input.Body.savingsPlanTypes[_] == enum_SavingsPlanType[_]
    input.Body.products[_] == enum_SavingsPlanProductType[_]
    input.Body.serviceCodes[_] == enum_SavingsPlanRateServiceCode[_]
    input.Body.usageTypes[_] == STRING
    input.Body.operations[_] == STRING
    input.Body.filters[_].name == enum_SavingsPlanRateFilterAttribute[_]
    input.Body.filters[_].values[_] == STRING
    input.Body.nextToken == STRING
    input.Body.maxResults == INTEGER
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DescribeSavingsPlansOfferings

enum_CurrencyCode := [ "CNY", "USD" ]
enum_SavingsPlanOfferingFilterAttribute := [ "region", "instanceFamily" ]
enum_SavingsPlanPaymentOption := [ "All Upfront", "Partial Upfront", "No Upfront" ]
enum_SavingsPlanProductType := [ "EC2", "Fargate", "Lambda", "SageMaker" ]
enum_SavingsPlanType := [ "Compute", "EC2Instance", "SageMaker" ]

valid {
    input.Body.offeringIds[_] == STRING
    input.Body.paymentOptions[_] == enum_SavingsPlanPaymentOption[_]
    input.Body.productType == enum_SavingsPlanProductType[_]
    input.Body.planTypes[_] == enum_SavingsPlanType[_]
    input.Body.durations[_] == LONG
    input.Body.currencies[_] == enum_CurrencyCode[_]
    input.Body.descriptions[_] == STRING
    input.Body.serviceCodes[_] == STRING
    input.Body.usageTypes[_] == STRING
    input.Body.operations[_] == STRING
    input.Body.filters[_].name == enum_SavingsPlanOfferingFilterAttribute[_]
    input.Body.filters[_].values[_] == STRING
    input.Body.nextToken == STRING
    input.Body.maxResults == INTEGER
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ListTagsForResource

valid {
    input.Body.resourceArn == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ReturnSavingsPlan

valid {
    input.Body.savingsPlanId == STRING
    input.Body.clientToken == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

TagResource

valid {
    input.Body.resourceArn == STRING
    input.Body.tags.STRING == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

UntagResource

valid {
    input.Body.resourceArn == STRING
    input.Body.tagKeys[_] == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}