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

provider/aws: CodeCommit - Currently only in us-east-1 #3274

Merged
merged 5 commits into from
Oct 30, 2015

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Sep 17, 2015

  • Schema
  • Resource
  • Acceptance Tests
  • Docs

In order to run the acceptance tests, we need to set an ENV_VAR for Region to be us-east-1

then we get the following results:

ake testacc TEST=./builtin/providers/aws TESTARGS='-run=CodeCommitRepository' 2>~/tf.log
go generate ./...
TF_ACC=1 go test ./builtin/providers/aws -v -run=CodeCommitRepository -timeout 90m
=== RUN TestAccAWSCodeCommitRepository_basic
--- PASS: TestAccAWSCodeCommitRepository_basic (5.39s)
=== RUN TestAccAWSCodeCommitRepository_withChanges
--- PASS: TestAccAWSCodeCommitRepository_withChanges (5.59s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    10.998s

@stack72 stack72 changed the title AWS CodeCommit [WIP] AWS CodeCommit Sep 17, 2015
@stack72 stack72 changed the title [WIP] AWS CodeCommit AWS CodeCommit Sep 18, 2015
@stack72 stack72 changed the title AWS CodeCommit AWS CodeCommit - Currently only in us-east-1 Sep 18, 2015
@stack72 stack72 changed the title AWS CodeCommit - Currently only in us-east-1 provider/aws: CodeCommit - Currently only in us-east-1 Sep 28, 2015
Starting to add the skeleton for the creation and update of a repository
…d to add some tests. The trouble for me right now is that CodeCommit is only in US-East-1 so I need to guard against that right now
need to error out early if the region is anything other than this

Also added a test that will show that changes get applied on subsequent
runs
@stack72
Copy link
Contributor Author

stack72 commented Oct 30, 2015

@radeksimko @phinze I have just rebased this PR. Technically, this is now complete as CodeCommit is only available in us-east-1 right now

Would love to know your thoughts

@@ -213,6 +215,9 @@ func (c *Config) Client() (interface{}, error) {

log.Println("[INFO] Initializing CodeDeploy Connection")
client.codedeployconn = codedeploy.New(sess)

log.Println("[INFO] Initializing CodeCommit SDK connection")
client.codecommitconn = codecommit.New(awsConfig)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm - did codecommit not get the new session.Session refactoring that the rest of the connections did this week? I'm surprised this builds!

I'd expect the line here to need usEast1Sess as the argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are 100% correct. I have just updated this commit. It should indeed be the sess work

I'm also surprised this built

@stack72
Copy link
Contributor Author

stack72 commented Oct 30, 2015

This has been updated to use the new sess based refactoring

}

func resourceAwsCodeCommitRepositoryCreate(d *schema.ResourceData, meta interface{}) error {
codecommitconn := meta.(*AWSClient).codecommitconn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stylistically we've tended to call the client just conn when it's a local variable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Unless of course you're juggling two in a given function.)

@phinze
Copy link
Contributor

phinze commented Oct 30, 2015

This looks great! Merging as is and I'll fix that style nit on master.

phinze added a commit that referenced this pull request Oct 30, 2015
provider/aws: CodeCommit - Currently only in us-east-1
@phinze phinze merged commit 3a7fa86 into hashicorp:master Oct 30, 2015
@stack72
Copy link
Contributor Author

stack72 commented Oct 30, 2015

Wow, you are on fire tonight! thanks :)

@stack72 stack72 deleted the aws-codecommit branch October 30, 2015 22:42
phinze added a commit that referenced this pull request Oct 30, 2015
@ghost
Copy link

ghost commented Apr 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants