Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
Accessing Amazon Global Infrastructure region table (for RestAPI or dotNet)

When the user selects an Amazon service (s3,CloudFront, etc) from a drop-down menu, I'd like to show only those regions/locations available for the selected service.

How can I determine this information? Is there a way to query Amazon's Global Infrastructure region table using RestAPI or dotNet?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

AWS Systems Manager can help with this. It has SDKs for various languages as well as a rest API.

For example, to get all the regions for the AWS Athena You can use GetParametersByPath with the path /aws/service/global-infrastructure/services/athena/regions

over 4 years ago · Santiago Trujillo Report

0

After answer by @adi-dembak, Here are my steps to achieve this task in .net

Add following SSM Managed Policy in aws and assign policy to user.

{
"Version": "2012-10-17",
"Statement": [
    {
        "Sid": "rule1",
        "Effect": "Allow",
        "Action": [
            "ssm:PutParameter",
            "ssm:GetParametersByPath"
        ],
        "Resource": "*"
    }
]}

Install AWSSDK.SimpleSystemsManagement

        string accessKey = "123##";
        string secretKey = "321##";

        HashSet<string> hash = new HashSet<string>();

        AmazonSimpleSystemsManagementClient amazonSimpleSystemsManagementClient =
            new AmazonSimpleSystemsManagementClient(accessKey, secretKey, Amazon.RegionEndpoint.USEast1);

        GetParametersByPathRequest getParametersByPathRequest = new GetParametersByPathRequest();
        getParametersByPathRequest.Path = "/aws/service/global-infrastructure/services/s3/regions/";
        getParametersByPathRequest.Recursive = true;

        GetParametersByPathResponse getParametersByPathResponse;

        do
        {
            getParametersByPathResponse = await amazonSimpleSystemsManagementClient.GetParametersByPathAsync(getParametersByPathRequest);
            foreach (Parameter item in getParametersByPathResponse.Parameters)
            {
                hash.Add(item.Value);

            }
            getParametersByPathRequest.NextToken = getParametersByPathResponse.NextToken;
        }
        while ((getParametersByPathResponse.NextToken != null) && !string.IsNullOrEmpty(getParametersByPathResponse.NextToken.ToString()));

        //Print HashSet
        foreach (string item in hash)
        {
            Console.WriteLine(item);
        }

GetParametersByPath is a paged operation. After each call you must retrieve NextToken from the result object, and if it's not null and not empty you must make another call with it added to the request.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!