How to get the price details for AWS Elastic IP using API?

83 views Asked by At

I am using pricing filter to get the Compute Instance price as below

filters := []*pricing.Filter{
        {
            Field: aws.String("productFamily"),
            Type:  aws.String("TERM_MATCH"),
            Value: aws.String("Compute Instance"),
        },
        {
            Field: aws.String("regionCode"),
            Type:  aws.String("TERM_MATCH"),
            Value: aws.String("us-east-1"),
        },
    }

pricingInput := &pricing.GetProductsInput{
        ServiceCode: aws.String("AmazonEC2"),
        Filters:     filters,
        NextToken:   nil,
    }

    for {
        pricingResult, err := csAdminAwsClient.GetPriceClient().GetProducts(pricingInput)
        if err != nil {
            return err
        }
        //Check for Next Token and continue the loop, else break
    }

This give me pricingResult containing the price details for different Instance Types.

But now I want to find the price details for an Elastic IP. What should be the productFamily for Elastic IP ?

      {
           Field: aws.String("productFamily"),
           Type:  aws.String("TERM_MATCH"),
           Value: aws.String("**Elastic IP**"),
       }
0

There are 0 answers