multiline string substitution in python

I am trying this out. account = "11111111111" tenant_name= "Demo" project_name= "demo" sns_access_policy = """{ "Version": "2012-10-17", "Statement": [ { "Sid": "0", "Effect": "Allow", "Principal": { "Service": "codestar-notifications.amazonaws.com" }, "Action": "sns:Publish", "Resource": "arn:aws:sns:eu-west-1:{account_id}:{tenant_name}-{project_name}-pipeline-monitoring" } ] }""" sns_access_policy = sns_access_policy.replace("{account_id}",account).replace("{tenant_name}",tenant_name).replace("{project_name}",project_name) This is doing my work, but I am looking something like f{string_substitution}. sns_access_policy = f"""{ "Version":… Read More multiline string substitution in python

AWS CDK says Argument of type 'this' is not assignable to parameter of type 'Construct'

I am working with a problem that has a few other similar solutions posted on stackoverflow (1) Argument of type ‘this’ is not assignable to parameter of type ‘Construct’ in AWS CDK (2) AWS CDK, typescript – Argument of type ‘this’ is not assignable to parameter of type ‘Construct’ I tried making all my aws… Read More AWS CDK says Argument of type 'this' is not assignable to parameter of type 'Construct'

exclude values from a string or dictionar in python

I am consulting the databases of a mongo cluster and I need it to show me all the databases except some of them this way i get the databases in dictionary form: for db in myclient.list_databases(): print(db) “ ` and the output is as follows: {‘name’: ‘databasetest’, ‘sizeOnDisk’: 32768.0, ’empty’: False} {‘name’: ‘databaseQA’, ‘sizeOnDisk’: 98304.0,… Read More exclude values from a string or dictionar in python

AWS application load balancer: Security group settings vs listener settings

When we define application load balancer in AWS, we first attach a security group to it which itself specifies things like protocol, port etc. Then we also define a listener group whee we again specify protocol, port etc. So how do they differ in their meaning and role in overall picture? >Solution : All resources… Read More AWS application load balancer: Security group settings vs listener settings

Receiving error "User: arn:aws:iam::11345636234528:user/my_Api is not authorized to perform: secretmanager:GetSecretValue on resouce: my_Resource"?

I am trying to execute my code from my ide and connect to aws resources through boto3. I go into the Secrets portal of the aws console. Inside aws secrets manager I find the resource titled my_api where my secrets are stored. I copy that name so that I can access the dict response of… Read More Receiving error "User: arn:aws:iam::11345636234528:user/my_Api is not authorized to perform: secretmanager:GetSecretValue on resouce: my_Resource"?