'How do I connect web3py to Amazon manage blockchain

Currently, I used the following python codes to connect to web3

from web3 import Web3
# Fill in your infura API key here
infura_url = "https://mainnet.infura.io/v3/djsoiqowejojoajsdooqw"
web3 = Web3(Web3.HTTPProvider(infura_url))

I am now using AWS managedblockchain, it gives me this credential:

Node ID
nd-GFJL!JJDANSANJQWEQNDSA
Blockchain instance type
bc.t3.large
Availability zone
us-east-1f
WebSocket EndpointInfo
nd-ajdsojasdnqkebjb1k2jbj.wss.ethereum.managedblockchain.us-east-1.amazonaws.com
HTTP EndpointInfo
nd-zVfjoaisjodbqiwubjud.ethereum.managedblockchain.us-east-1.amazonaws.com
ARN
arn:aws:managedblockchain:us-east-1:871628371628:nodes/nd-JASDOIOWQEBJABKJA

How do I used this information to access web3 using web3py?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source