Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

253
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda