Code Monkey home page Code Monkey logo

Comments (5)

brikis98 avatar brikis98 commented on May 18, 2024

What do you mean those methods are not implemented? They are all implemented here: https://github.com/gruntwork-io/terratest/blob/9348b5bd2fbfbe5fcf3c40b59117c16670c1f3b9/modules/aws/auth.go

from terratest.

Briansbum avatar Briansbum commented on May 18, 2024

Sorry I probably misspoke there.

I mean they're not available to be used in any other sections of the AWS module.

For example the S3 functions terratest/modules/aws/s3.go only make use of NewAuthenticatedSession with no way to use another method of authentication.

from terratest.

brikis98 avatar brikis98 commented on May 18, 2024

Ah, I see what you mean. I can definitely see cases where you may want to pass in a custom Session of some sort.

I suspect this would require a fairly large change. One way to do it that is mostly backwards compatible is to update every method that uses the AWS APIs from:

func SomeMethodThatUsesAWS(t *testing.T, someParam string) {
  sess := NewAuthenticateSession()
  ec2 := ec2.New(sess)
}

To:

func SomeMethodThatUsesAWS(t *testing.T, someParam string, sess ... *session.Session) {
  sess := NewAuthenticateSession(sess)
  ec2 := ec2.New(sess)
}

And to update NewAuthenticatedSession to use the passed in Session, if one is specified:

func NewAuthenticatedSession(sess ... *session.Session) {
  if len(sess) > 0 {
    return sess[0]
  }

  // Otherwise, use the original logic
}

from terratest.

Briansbum avatar Briansbum commented on May 18, 2024

This looks like it would work nicely, I'll have a look at making it work.

from terratest.

Briansbum avatar Briansbum commented on May 18, 2024

Resolved in #119

from terratest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.