Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 04 16:35
    jjmalina opened #64
  • Jan 29 2020 19:15
    pjfanning commented #58
  • Jan 29 2020 17:50
    franchev commented #58
  • Jan 23 2020 22:22
    geraldstanje commented #63
  • Jan 23 2020 15:37
    geraldstanje commented #63
  • Jan 23 2020 15:35
    geraldstanje commented #63
  • Jan 23 2020 15:08
    montpetitg commented #63
  • Jan 23 2020 15:07
    montpetitg commented #63
  • Jan 23 2020 05:22
    geraldstanje commented #63
  • Jan 23 2020 05:22
    geraldstanje commented #63
  • Jan 23 2020 05:21
    geraldstanje commented #63
  • Jan 17 2020 18:57
    montpetitg commented #63
  • Jan 17 2020 18:56
    montpetitg commented #63
  • Jan 02 2020 14:25
    wiktorolko commented #63
  • Dec 21 2019 14:41
    maziyarpanahi commented #63
  • Nov 20 2019 22:05
    tpiron commented #63
  • Nov 19 2019 17:07
    jjmalina opened #63
  • Sep 06 2019 02:35
    kimxogus opened #62
  • May 13 2019 11:38
    schneist commented #58
  • May 13 2019 11:19
    schneist commented #58
Benjamin Rizkowsky
@benoahriz
that is an example of the bucket policy i'm currently using
Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied;
Benjamin Rizkowsky
@benoahriz
using a separate account works fine but has access to everything. Im trying to lock the account down to the minimum needed permissions
   "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:ListAllMyBuckets",
            "Resource": "arn:aws:s3:::*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket",
                "s3:GetBucketLocation"
            ],
            "Resource": "arn:aws:s3:::xxxx"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:*"
            ],
            "Resource": "arn:aws:s3:::xxxx/*"
        }
    ]
}
this seemed to work fine
Alexey Alekhin
@laughedelic
hi @benoahriz.
As I see from the code in ivy-s3-resolver (which is used in this plugin), there is no much happening besides listObjects/putObject actions..
probably s3:PutObjectAcl is needed? (here)
on the other hand s3:DeleteObject is not needed, because resolver cannot delete a published artifact
Benjamin Rizkowsky
@benoahriz
cool thanks @laughedelic I’ll try it
Alexey Alekhin
@laughedelic
I've just tested it and I think s3:PutObjectAcl is the missing chain. Here is the policy which I successfully used for publishing and resolving:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": "arn:aws:s3:::bucket.name"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:PutObjectAcl",
                "s3:GetObject"
            ],
            "Resource": "arn:aws:s3:::bucket.name/*"
        }
    ]
}
In theory s3:CreateBucket may be also needed if you publish to a non-existing bucket.
@benoahriz thanks for raising this concern, I should add this to the readme. Tell me if it works for you now.
Benjamin Rizkowsky
@benoahriz
yeah i’ll test it and let you know
Alexey Alekhin
@laughedelic
:+1: :shipit: :satisfied:
Benjamin Rizkowsky
@benoahriz
i tested it and it worked fine i sent a pr for the readme
also added an example of using the aws credentials and env vars if you set them which is how im implementing it
Alexey Alekhin
@laughedelic
Cool. Thanks @benoahriz :+1:
Benjamin Rizkowsky
@benoahriz
np
Pishen Tsai
@pishen

Hello, I tried to use the plugin like this

import com.amazonaws.auth._

lazy val root = (project in file(".")).settings(
  name := "helpers",
  version := "0.6.0",
  scalaVersion := "2.10.6",
  organization := "net.pishen",
  libraryDependencies ++= Seq(
    "com.typesafe.play" %% "play-json" % "2.3.10",
    "com.github.nscala-time" %% "nscala-time" % "2.6.0"
  ),
  publishMavenStyle := false,
  s3credentials := new EnvironmentVariableCredentialsProvider(),
  s3region := Region.fromValue("us-west-2"),
  publishTo := Some(s3resolver.value("S3 Repository", s3("my-bucket")).withIvyPatterns)
)

But it said that it can't find the value Region

error: not found: value Region
  s3region := Region.fromValue("us-west-2"),
              ^
sbt.compiler.EvalException: Type error in expression
    at sbt.compiler.Eval.checkError(Eval.scala:384)
    at sbt.compiler.Eval.compileAndLoad(Eval.scala:183)
    at sbt.compiler.Eval.evalCommon(Eval.scala:152)
    at sbt.compiler.Eval.evalDefinitions(Eval.scala:122)
    at sbt.EvaluateConfigurations$.evaluateDefinitions(EvaluateConfigurations.scala:271)
    at sbt.EvaluateConfigurations$.evaluateSbtFile(EvaluateConfigurations.scala:109)
    at sbt.Load$.sbt$Load$$loadSettingsFile$1(Load.scala:712)
    at sbt.Load$$anonfun$sbt$Load$$memoLoadSettingsFile$1$1.apply(Load.scala:717)
...

And if I add this line import com.amazonaws.services.s3.model._ to my build.sbt it will work. Seems that it can't see the type aliases in autoImport?

Alexey Alekhin
@laughedelic
Hi @pishen! Sorry, I was on vacations and missed the notification. This behaviour is correct. A type alias just provides a shorter name for the type, it doesn't "reexport" Region object from the amazonaws lib. So yes, you need to do the corresponding import.
Alexey Alekhin
@laughedelic

@/all v0.17.0 is out:

  • #51: Upgraded to SBT 1.x (by @macalinao)
  • #25: Published to Bintray community repository
  • #35: Added storage class setting
  • Upgraded to ivy-s3-resolver v0.11.0

https://twitter.com/laughedelic/status/910148754065457152

Alexey Alekhin
@laughedelic

@/all Thanks to the effort of Michael Ahlers @michaelahlers, we've got a new bugfix release that workarounds the problem with redundant delimiters in the ivy-style patterns introduced in sbt 1.0 (see #52 and sbt/sbt#3573).

Everybody is recommended to update to v0.17.1

Michael Ahlers
@michaelahlers
:+1:
Alexey Alekhin
@laughedelic
@/all Forgot to announce that a week ago we had a new release: v0.18.0 with a contribution from @hkupty :tada:
  • #55: Changed s3acl type to Option[S3ACL]: when it's unset, artifacts will be published inheriting the bucket ACL
Michael Ahlers
@michaelahlers
:clap:
Alexey Alekhin
@laughedelic
@/all New release: v0.19.0 with a nice contribution from @tsuyoshizawa :tada:
Fernando
@nandotorterolo
Hi, icould you provide me and example for, 'sbt.version=0.13.15' and 'scalaVersion := "2.12.3"', is this line in plugins.sbt ok? resolvers += Resolver.jcenterRepo
addSbtPlugin("ohnosequences" % "sbt-s3-resolver" % "0.16.0")
Alexey Alekhin
@laughedelic
Hi @nandotorterolo. If you are using sbt-0.13, the right version of the sbt-s3-resolver is 0.16.0, this is correct. But you have to check the readme for that version: it was published to a different repository:
resolvers += "Era7 maven releases" at "https://s3-eu-west-1.amazonaws.com/releases.era7.com"
addSbtPlugin("ohnosequences" % "sbt-s3-resolver" % "0.16.0")
Regarding, scalaVersion := "2.12.3", I guess, you have it in your build.sbt, which is irrelevant for the plugin. Scala version which is used for the plugins is determined by the version of sbt:
  • sbt 0.13 works with Scala 2.10
  • sbt 1.0 works with Scala 2.12
Do you have any good reason to stay on sbt 0.13 instead of upgrading to sbt 1.0?
Fernando
@nandotorterolo
thanks for your detailed explanation, reason is that I need other plugins with status wip: https://github.com/sbt/sbt/wiki/sbt-1.x-plugin-migration
Alexey Alekhin
@laughedelic
OK. I'm just curious what are they? (if not too many)
By the way, you should be aware, that this list is updated mostly manually, so some things are out of date there.
Fernando
@nandotorterolo
good tip, maybe I need to upgrade sbt version, and upgrade all plugins, I will post information if I can not resolve them
Alexey Alekhin
@laughedelic
:+1:
Fernando
@nandotorterolo
@laughedelic let me explain my use case, I actually use 'io.get-coursier:sbt-coursier' plugin, which It doesn't currently work with the SBT 1.0. If I do not use coursier plugin, sbt-s3-resolver works!, but if I use both, it doesn't, and have this message '[warn] Unrecognized repository <name> resolver, ignoring it' It was reported time ago, will reopen the bug. coursier/coursier#182
Fernando
@nandotorterolo
Alexey Alekhin
@laughedelic
I don't know anything about this issue, will have to read that threah later.
Have you tried using https://github.com/rtfpessoa/coursier-s3 instead?
Fernando
@nandotorterolo
yes, but without success, unmaintained repo :( rtfpessoa/coursier-s3#4
Alexey Alekhin
@laughedelic
@nandotorterolo OK, I see. It's sad that it was abandoned.. I'm not sure I can help you right away with coursier as I don't use it myself and I don't know when I will have time to try it out and dig into this issue. Try asking coursier people and if you figure it out or get any relevant information, please keep me updated, write here or open an issue. It will be much appreciated by me and other user who might have similar problems.
Fernando
@nandotorterolo
ok, will post in coursier-team and try to move this stuff, thanks!
Alexey Alekhin
@laughedelic
ánimo! :+1:
Artsiom Miklushou
@mikla

Hello there.
I'm facing problems with resolving dependencies from S3.

I have ~/.aws/config like this:

[default]
region = eu-central-1
output = json

[my-project]
region = eu-central-1

I have ~./aws/credentials like this

[my-project]
aws_access_key_id = A...
aws_secret_access_key = X...

(I also tried to add empty [default] section here.

aws s3 ls s3://releases.my-project.io/some-ivy-file.ivy --profile my-project returns me list of files.

But, sbt can't resolve deps.
version 0.13.16

I also tried to export AWS_PROFILE=my-project without any luck.

Any suggestions? Thanks in advance

Artsiom Miklushou
@mikla
MacOs 10.13.1
Michael Ahlers
@michaelahlers
@mikla, for troubleshooting purposes (I understand this is not optimal), what if you try adding the following to any SBT file?
awsProfile := "my-project"
s3region := com.amazonaws.regions.Regions.EU_CENTRAL_1
Alexey Alekhin
@laughedelic
Oh, sorry @mikla, I forgot to reply to you! :sweat:
@michaelahlers thanks for support :+1:
Michael Ahlers
@michaelahlers
Glad to help, @laughedelic! I've brought S3 Resolver into projects at work, so I'm current on tutoring others a bit. ;)
Alexey Alekhin
@laughedelic
Cool! :clap:
@mikla if you're using sbt 0.13 you can only use some old version of the plugin, I think 0.16.0. right?
So in that old version awsProfile setting affected only credentials, not the region (hence, as @michaelahlers says, you have to set the region explicitly). In the newer versions it has been fixed, but it's available only for sbt-1.x