2015-06-01 07:07:32 +02:00
|
|
|
package aws
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/awslabs/aws-sdk-go/aws"
|
|
|
|
"github.com/hashicorp/terraform/helper/schema"
|
|
|
|
)
|
|
|
|
|
2015-10-07 22:35:06 +02:00
|
|
|
func makeAwsStringList(in []interface{}) []*string {
|
2015-06-01 07:07:32 +02:00
|
|
|
ret := make([]*string, len(in), len(in))
|
|
|
|
for i := 0; i < len(in); i++ {
|
|
|
|
ret[i] = aws.String(in[i].(string))
|
|
|
|
}
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func makeAwsStringSet(in *schema.Set) []*string {
|
|
|
|
inList := in.List()
|
|
|
|
ret := make([]*string, len(inList), len(inList))
|
|
|
|
for i := 0; i < len(ret); i++ {
|
|
|
|
ret[i] = aws.String(inList[i].(string))
|
|
|
|
}
|
|
|
|
return ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func unwrapAwsStringList(in []*string) []string {
|
|
|
|
ret := make([]string, len(in), len(in))
|
|
|
|
for i := 0; i < len(in); i++ {
|
|
|
|
if in[i] != nil {
|
2015-10-08 14:48:04 +02:00
|
|
|
ret[i] = *in[i]
|
2015-06-01 07:07:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret
|
|
|
|
}
|