For context, I have tested out the solution mentioned here in https://sst.dev/chapters/handling-secrets-in-sst.html. The solution works, but I have to manually set the secrets on the command line. I would like to do the same using code, where I extract environmental variables and add them as secrets to AWS, which I will then bind to the various AWS Lambdas without the need for command line operations.
I have tried to replicate the writing of secrets to the AWS SSM Parameter Store with the AWS CDK StringParameter construct (https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ssm.StringParameter.html). However, I am facing a roadblock where it appears that Parameters of type SecureString cannot be created directly from a CDK application (https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ssm.ParameterType.html). I tried to use the AWS Secrets Manager CDK (https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.Secret.html) to write the secrets as well, but it did not work out. Can I check if anyone has solved this issue before? Any help will be greatly appreciated!