Everyone does anyone have an idea of how to use AWS AppConfig with the AWS SDK PHP. My Particular use case is, I am running a simple PHP app on the EC2 instance and want to receive the JSON configurations written in the AppConfig.
use Aws\AppConfig\Exception\AppConfigException;
use Aws\AppConfig\AppConfigClient;
$appConfigClient = new AppConfigClient(['version' => 'latest', 'region' => 'ap-south-1']);
$clientid = uniqid('', true);
$params = [
'Application' => $APP_CONFIG_APP,
'ClientId' => $clientid,
'Configuration' => $APP_CONFIG_CONFIGURATION_PROFILE,
'Environment' => $APP_CONFIG_ENVIRONMENT
];
$response = $appConfigClient->getConfiguration($params);
$config = $response['Content'];
Also, I am authorizing with the AppConfig by an Administrator IAM Role Provided so, no issues on that side and I am able to get the following output
{ "Content": {}, "ConfigurationVersion": "1", "ContentType": "application\/octet-stream", "@metadata": { "statusCode": 200, client_id=60696", and some more fields...}
But the issue is I am not getting the AppConfig Content but able to extract the metadata regarding the Data. So, Anyone who had tried this please help me out here.