Comments (3)
I'm currently having the same issue.
Did you manage to solve it?
Thanks, Kava.
from aws-deeplens-worker-safety-project.
I have not.
from aws-deeplens-worker-safety-project.
from https://forums.aws.amazon.com/thread.jspa?threadID=287187
Create policy
- go to IAM console https://console.aws.amazon.com/iam/home?region=us-east-1
- on the left panel, click on "policies", then click "create policy"
- on the next page, click on "choose a service", then choose "s3"
- for "actions", you can pick "list", "read" and "write" for now, you can revise the permission later.
- for "resources", you can specify bucket and object by providing the ARNs, or choose "all resources" to allow access to all your s3 resources
- you don't need to specify "request conditions"
- click "review policy" to go to the next page
- review policy and choose a name for the policy, then click "create policy"
- go back to IAM console, click on "roles", you should see "AWSDeepLensGreengrassGroupRole"
- click on that role, then click on "attach policy", choose the policy you just created.
You can find more information about IAM policy here: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html
and my code is
import boto3
from botocore.session import Session
def write_image_to_s3(cv2frame):
session = Session()
creds = session.get_credentials()
s3 = session.create_client('s3',
aws_access_key_id=creds.access_key,
aws_secret_access_key=creds.secret_key,
aws_session_token=creds.token)
file_name = 'xyz.jpg'
encode_param=[int(cv2.IMWRITE_JPEG_QUALITY),90]
_, jpg_data = cv2.imencode('.jpg', cv2frame, encode_param)
response = s3.put_object(Bucket="yourbucketname", Body=jpg_data.tostring(),Key=file_name)
from aws-deeplens-worker-safety-project.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-deeplens-worker-safety-project.