Comments (13)
I used the version 6. The input was wrong I had to:
input = %{policyDocument: test}
with test = Poison.encode!(%{
"Version": "2012-10-17",
"Statement": [
%{
"Effect": "Allow",
"Action": [
"iot:Publish",
"iot:Receive"
],
"Resource": [
"arn:aws:iot:us-west-2:000000000000:topic/topic_1",
"arn:aws:iot:us-west-2:000000000000:topic/topic_2"
]
},
%{
"Effect": "Allow",
"Action": [
"iot:Subscribe"
],
"Resource": [
"arn:aws:iot:us-west-2:000000000000:topicfilter/topic_1",
"arn:aws:iot:us-west-2:000000000000:topicfilter/topic_2"
]
},
%{
"Effect": "Allow",
"Action": [
"iot:Connect"
],
"Resource": [
"arn:aws:iot:us-west-2:000000000000:client/basicPubSub"
]
}
]
})
I put the problem on solve thanks for your time
from aws-elixir.
Hi, @RandomGuy2020! Thanks for opening the issue.
The input value is a policy like the one in the example: https://docs.aws.amazon.com/cli/latest/reference/iot/create-policy.html#examples
We are investigating how to improve our docs to include some examples like these.
from aws-elixir.
Thanks for you quick reply! I'm very sorry but i'm very bad and it doesn't work when you will have time could you see the code below and say to me what's is wrong ?
Here is the code (I replace the 000000000000 by my id account) :
`
client1 = initClient()
input = %{
"Version": "2012-10-17",
"Statement": [
%{
"Effect": "Allow",
"Action": [
"iot:Publish",
"iot:Receive"
],
"Resource": [
"arn:aws:iot:us-west-2:000000000000:topic/topic_1",
"arn:aws:iot:us-west-2:000000000000:topic/topic_2"
]
},
%{
"Effect": "Allow",
"Action": [
"iot:Subscribe"
],
"Resource": [
"arn:aws:iot:us-west-2:000000000000:topicfilter/topic_1",
"arn:aws:iot:us-west-2:000000000000:topicfilter/topic_2"
]
},
%{
"Effect": "Allow",
"Action": [
"iot:Connect"
],
"Resource": [
"arn:aws:iot:us-west-2:000000000000:client/basicPubSub"
]
}
]
}
AWS.IoT.create_policy(client1, "testelixir", input)
`
Thanks you for your time 😄
from aws-elixir.
@RandomGuy2020 I think you need to send the input as a JSON string, because it won't be converted automatically. Can you give a try and check if works?
PS: you have Poison
available, so you can encode as the docs suggest: https://github.com/devinus/poison#usage
from aws-elixir.
It doesn't work too when I use
input=Poison.encode!(...)
And the error is still {:error, nil}
from aws-elixir.
@RandomGuy2020 can you try to create the same policy using AWS console?
Also, do you see warnings when you try to create the policy?
from aws-elixir.
It's working on aws console and I don't have warning
from aws-elixir.
OK, thank you! One more try: would you mind to use the GitHub version and see if works?
Just change your mix.exs
to point to this repository: {:aws, github: "aws-beam/aws-elixir"}
.
from aws-elixir.
Ok now I have an error 400, when I let the Poison.encode!(..) I don't have a message for the error but when I remove it I always have an error 400 but the body error is : "message":"1 validation error detected: Value null at 'policyDocument' failed to satisfy constraint: Member must not be null"
from aws-elixir.
@RandomGuy2020 cool! We got something :D
I have an idea that is to use another HTTP client and log the request/response. Tesla has this middleware that logs the request, so we can use that to inspect what is going on. But the process of configuring another HTTP client is not documented yet (it was introduced in #42), so I will try to document it first.
from aws-elixir.
I want to add the get_policy doesnt work with {:aws, github: "aws-beam/aws-elixir"} they say : The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
But it's working on the version 6
from aws-elixir.
@RandomGuy2020 - I am getting the same error The request signature we calculated does not match the signature you provided.
when calling AWS.IoT.list_things
.
The client works fine for AWS.S3
queries. I have been trying a few versions of aws-elixir
to see which one works but haven't been able to identify one yet. When you refer to version 6
do you mean the release 0.6.0
?
I will open a new issue if your response does not resolve it.
from aws-elixir.
@tejpochiraju did you try the version from GitHub (the master branch)?
from aws-elixir.
Related Issues (20)
- nxdomain errror when using AWS.Location.search_place_index_for_text HOT 7
- Loading issue with modules that shouldn't be generated: AWS.Cloudsearchdomain and AWS.Importexport (Instead of CamelCase counterparts) HOT 2
- AWS.ApiGatewayManagementApi, URL and headers with stage HOT 1
- S3 put_object returns {:error, :timeout} but uploads file correctly HOT 5
- `AWS.S3.delete_objects` content md5 header HOT 5
- SelectObjectContent response HOT 1
- `AWS.STS.assume_role_with_web_identity` should not rely on access_key_id and secret_access_key
- Error calling textractor HOT 3
- Setting endpoint to `amazonaws.com` results in different behaviour as not setting an endpoint HOT 1
- AWS.S3.get_object always returns {:error, :timeout} with hackney > 1.18.1 HOT 5
- Streaming response handling HOT 10
- `put_bucket_cors` request is incorrect HOT 5
- Setup pipeline to automatically roll out new releases upon tagging
- S3 ListParts returns wrong types HOT 7
- QLDB Commit Transaction HOT 2
- NXDOMAIN when calling CostExplorer.get_cost_and_usage HOT 5
- Cannot get AWS Polly synthesize_speech to work HOT 3
- :nxdomain when calling AWS.CloudFront.list_distributions HOT 5
- Wrong region for Route53 requests HOT 12
- AWS.TimestreamWrite does not work. HOT 5
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-elixir.