Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coerce exception while adding a rule to the security group #67

Closed
murtaza52 opened this issue Sep 12, 2014 · 2 comments
Closed

coerce exception while adding a rule to the security group #67

murtaza52 opened this issue Sep 12, 2014 · 2 comments

Comments

@murtaza52
Copy link

Hi,

I am trying to add a new rule to a security group I created.

(http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/authorize-ingress.html)

(ns aws-infra.security-groups
(:require [amazonica.core :as aws-core :refer [defcredential]]
[amazonica.aws.ec2 :as aws-ec2])))

(aws-ec2/authorize-security-group-ingress
:group-name "test-group"
:ip-permissions [{:cidr-ip "21.21.22.23/32"
:ip-protocol "tcp"
:from-port "22"
:to-port "22"}])

I get the below exception, can you please help ?

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character
RT.java:1087 clojure.lang.RT.intCast
core.clj:846 clojure.core/int
core.clj:314 amazonica.core/coerce-value
core.clj:508 amazonica.core/invoke-method
AFn.java:160 clojure.lang.AFn.applyToHelper

@murtaza52
Copy link
Author

I was breaking my head over this from last couple of hrs. Giving the form-port as integer instead of a string solved it. Sorry for spamming you. Do you have suggestions how I can debug / trace such errors ?

@mcohen01
Copy link
Owner

It helps to have a Java background. And for many tasks you need to have the Javadocs open in the browser, and then you'd see setFromPort takes an int as its argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants