How to deploy AWS Appconfig hosted configuration version via AWS CLI

865 Views Asked by At

I have been following this document to create a hosted version in AppConfig via CLI.

Issue : The content parameter in the aws command expects a strict type of blob. I want to upload a relative large yaml file of approx 40kB which is present in my code repo as the content which is of type blob.

What would be the ideal way to convert this yaml file to base64 and add to the content param all via CLI?

I manually tried to convert the yaml to base64 and add in the command but CLI couldn't handle that much data and didn't respond.

Note : Using Powershell in VSCode Windows

1

There are 1 best solutions below

0
On

I see you are using PowerShell. If you are able to install the AWS CLI in your PowerShell environment, using --content fileb://mylargefile.yaml should allow you to upload your large YAML file as an AppConfig hosted configuration version. There is no need to do any Base64 conversion of your file before running the command.

Example

$ aws appconfig create-hosted-configuration-version \
    --application-id "yourid" \
    --configuration-profile-id "yourid" \
    --content-type text/plain \
    --region us-east-1 \
    --content fileb://mylargefile.yaml \
    configuration_version_output_file
{
    "ApplicationId": "yourid",
    "ConfigurationProfileId": "yourid",
    "VersionNumber": "1",
    "ContentType": "text/plain"
}

See Best practices for local file parameters