I have a code that results in multiple string objects and I want to convert them into an array. The end result looks like this
Queue1
Queue2
Queue3
but, I need it like this
[Queue1, Queue2, Queue3]
P.S. I am new to programming
import boto3
import numpy
rg = boto3.client('resource-groups')
cloudwatch = boto3.client('cloudwatch')
#def queuenames(rg):
response = rg.list_group_resources(
Group='env_prod'
)
resources = response.get('Resources')
for idents in resources:
identifier = idents.get('Identifier')
resourcetype = identifier.get('ResourceType')
if resourcetype == 'AWS::SQS::Queue':
RArn = identifier.get('ResourceArn')
step0 = RArn.split(':')
step1 = step0[5]
print(step1)