Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically list Current AWS Support Plan? (AWSPowerShell or AWS CLI 1/2)

I am looking to programmatically List my Current Support Plan that is active in AWS (Basic, Business, Enterprise On-Ramp, Enterprise). I cannot find this anywhere in AWS's AWSPowerShell Help or AWS CLI Help.

Is this possible to find this value programmatically using AWS CLI or AWSPowerShell? Requested call and output would be similar to:

C:\> Get-CurrentPremiumSupportPlan

Output: "Business"

Reference:

  • Similar StackOverflow question, but my question is only about showing/listing/describing the current value, not changing it: Can the AWS Support Plan be changed via CLI/API?
  • AWS Support Plans. There are only 4 to choose from - https://aws.amazon.com/premiumsupport/plans/
  • AWS PowerShell help (general) - https://docs.aws.amazon.com/powershell/
  • AWS CLI help (general) - https://docs.aws.amazon.com/cli/index.html
like image 209
miscellaneous_user19202122 Avatar asked Nov 20 '25 19:11

miscellaneous_user19202122


2 Answers

From this post: https://aws.amazon.com/blogs/mt/aws-partners-determine-aws-support-plans-in-organization/

Seems that it can not be done directly (does not exist some API Call to get the Support plan) but you can use the describe-severity-levels API and based on the response determine which Support plan you have.

  • If an AWS account has an Enterprise support plan, the highest severity levels returned are critical and urgent.
  • If an account has a Business support plan, the highest severity level returned is urgent.
  • For the Developer support plan, the severity levels returned are low and normal.
  • If a premium AWS Support plan is not currently enabled, the following error is returned: "An error occurred (SubscriptionRequiredException) when calling the DescribeSeverityLevels operation: AWS Premium Support Subscription is required to use this service."
like image 135
OARP Avatar answered Nov 22 '25 22:11

OARP


Like the accepted answer, similar to the following is what I've used:

    SUPPORT_STATUS=$(eval aws support describe-severity-levels --region us-east-1 2>&1)
    if [[ "$SUPPORT_STATUS" == *"SubscriptionRequiredException"* ]]; then
        echo "No Support Enabled for account"
    elif [[ "$SUPPORT_STATUS" == *"AccessDeniedException"* ]]; then
        echo "Access denied or roles not properly setup"
    elif [[ "$SUPPORT_STATUS" == *"critical"* ]]; then
        echo "Enterprise Support already enabled for account..."
    elif [[ "$SUPPORT_STATUS" == *"urgent"* ]]; then
        echo "Only Business Level Support enabled for account..."
    elif [[ "$SUPPORT_STATUS" == *"high"* ]]; then
        echo "Only Developer Level Support enabled for account..."
    fi

...also, I believe they are about to release the ability to manage support plans via API natively as https://docs.aws.amazon.com/awssupport/latest/user/security-support-plans.html added only a few days ago with the following actions:

supportplans:GetSupportPlan
supportplans:GetSupportPlanUpdateStatus
supportplans:StartSupportPlanUpdate

It still hasn't hit AWS CLI and Boto though...

like image 36
TryTryAgain Avatar answered Nov 23 '25 00:11

TryTryAgain