from troposphere import Template, Tags
from troposphere.secretsmanager import Secret, GenerateSecretString

t = Template()
t.add_version('2010-09-09')

MySecret = t.add_resource(Secret(
    "MySecret",
    Name="MySecret",
    Description="This is an autogenerated secret",
    GenerateSecretString=GenerateSecretString(
        SecretStringTemplate="{\"username\":\"test-user\"}",
        GenerateStringKey="password",
        PasswordLength=30,
    ),
    Tags=Tags(
        Appname="AppA"
    )
))

print(t.to_json())
