How to retrieve all hosted AWS App configurations by environment?

75 Views Asked by At

I am using AWS APP Config. I have 2 environments (DEV, PROD). I couldn`t find how can I retrieve all hosted configuration by environment? I am using C# and AWSSDK.AppConfig 3.7.102.32

I tried

var listConfiguration = await _amazonAppConfig.ListHostedConfigurationVersionsAsync(new ListHostedConfigurationVersionsRequest
{
ApplicationId = _applicationId,
ConfigurationProfileId = configurationProfileId
});

But it returns all hosted configuration but cannot differ which one is for PROD or for DEV

1

There are 1 best solutions below

0
Chaurasiya On

Use ListDeployments to get all the deployments for an Application using ApplicationId and EnvironmentId.

Lists the deployments for an environment in descending deployment number order.

Example:-

var client = new AmazonAppConfigClient();
var response = client.ListDeployments(new ListDeploymentsRequest 
{
    ApplicationId = "339ohji",
    EnvironmentId = "54j1r29"
});

List<DeploymentSummary> items = response.Items;