Boto3 not retrieving users from AWS Appstream whats the issue

0 votes
Hi All,

I'm trying to retrieve users from AWS Appstream Stack. Below one is my Boto3 code. There is no error, but this code doesn't give any output. Can any one check and let me where im wrong?

#!/usr/bin/env python3

import boto3
import awscli

client = boto3.client('appstream',aws_access_key_id='xxxx',aws_secret_access_key='yyyy')
session = boto3.Session(region_name='us-west-2', profile_name='exampleaws')

response = client.describe_user_stack_associations(
    StackName='ss',
    AuthenticationType='USERPOOL'
)
Sep 21, 2020 in DevOps on Cloud by Lakshminarayanan
• 1,370 points
770 views

1 answer to this question.

+1 vote
Hi@Lakshminarayanan,

I think you didn't get any output because you have not print anything in your script. Use print keyword to print your response.
answered Sep 21, 2020 by MD
• 95,440 points
I have tried with

print(response)

Its printing something. But not listing user names
Hi,

Maybe it is printing some extra information as well. Try to find out the exact keyword from that output that holds the user name. And accordingly, customize your code.
Hi bro,

its printing like below. But exactly name is not listing.

{'UserStackAssociations': [], 'ResponseMetadata': {'RequestId': '30cd9783--429b-b39d-7xxxxxxxxx6', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '30cd9783--429b-b39d-7xxxyxyxyxx', 'content-type': 'application/x-amz-json-1.1', 'content-length': '28', 'date': 'Mon, 21 Sep 2020 11:17:55 GMT'}, 'RetryAttempts': 0}}.

Not listing users.. bro
Its my complete code. Kindly check and add if anything missing.

#!/usr/bin/env python3

import boto3
import awscli

client = boto3.client('appstream',aws_access_key_id='xxxxx',aws_secret_access_key='yyyy')
session = boto3.Session(region_name='us-west-2')
response = client.describe_user_stack_associations(
    StackName='ss',
    UserName = 'Latchu',
    AuthenticationType='USERPOOL',
    MaxResults = 10
    #NextToken = 'string'
)

print(response)

Hi,

Can you try with describe_users instead of describe_user_stack_associations​? Just see what it is showing. You can take help from the below given link.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/appstream.html#AppStream.Client.describe_users

i have checked with describe_users . But same output, Users not listing

its like permission issue, i have solved
Great, Can you explain what was the problem?

Related Questions In DevOps on Cloud

+2 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Adding public contact from request to aws

Third one seems to be the best ...READ MORE

answered Jun 28, 2018 in DevOps on Cloud by DareDev
• 6,890 points
370 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,503 views
+2 votes
1 answer
0 votes
1 answer

How to use aws-cli commands inside Boto3?

Hi@Lakshminarayanan, I am not able to understand the ...READ MORE

answered Sep 21, 2020 in DevOps on Cloud by MD
• 95,440 points
5,035 views
0 votes
1 answer

How to use the pipeline setup and deploy the war file using the ansible,docker and kubernettes

Hi@Venkata, You can create an Ansible-Playbook to deploy ...READ MORE

answered Sep 1, 2020 in DevOps on Cloud by MD
• 95,440 points
791 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP