From d64dd99d4d17b5629df8ef6917b5eb71dea81a16 Mon Sep 17 00:00:00 2001 From: aznashwan Date: Mon, 27 Apr 2015 21:06:49 +0300 Subject: [PATCH] Fixed/added docstrings in aws provider package. --- builtin/providers/aws/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/config.go b/builtin/providers/aws/config.go index 9c6599258..26e69e779 100644 --- a/builtin/providers/aws/config.go +++ b/builtin/providers/aws/config.go @@ -105,8 +105,8 @@ func (c *Config) Client() (interface{}, error) { return &client, nil } -// IsValidRegion returns true if the configured region is a valid AWS -// region and false if it's not +// ValidateRegion returns an error if the configured region is not a +// valid aws region and nil otherwise. func (c *Config) ValidateRegion() error { var regions = [11]string{"us-east-1", "us-west-2", "us-west-1", "eu-west-1", "eu-central-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", @@ -120,6 +120,8 @@ func (c *Config) ValidateRegion() error { return fmt.Errorf("Not a valid region: %s", c.Region) } +// ValidateAccountId returns a context-specific error if the configured account +// id is explicitly forbidden or not authorised; and nil if it is authorised. func (c *Config) ValidateAccountId(iamconn *iam.IAM) error { if c.AllowedAccountIds == nil && c.ForbiddenAccountIds == nil { return nil