github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshift/authenticationProfile.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package redshift 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Creates a Redshift authentication profile 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "encoding/json" 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshift" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // tmpJSON0, err := json.Marshal(map[string]interface{}{ 35 // "AllowDBUserOverride": "1", 36 // "Client_ID": "ExampleClientID", 37 // "App_ID": "example", 38 // }) 39 // if err != nil { 40 // return err 41 // } 42 // json0 := string(tmpJSON0) 43 // _, err = redshift.NewAuthenticationProfile(ctx, "example", &redshift.AuthenticationProfileArgs{ 44 // AuthenticationProfileName: pulumi.String("example"), 45 // AuthenticationProfileContent: pulumi.String(json0), 46 // }) 47 // if err != nil { 48 // return err 49 // } 50 // return nil 51 // }) 52 // } 53 // 54 // ``` 55 // <!--End PulumiCodeChooser --> 56 // 57 // ## Import 58 // 59 // Using `pulumi import`, import Redshift Authentication by `authentication_profile_name`. For example: 60 // 61 // ```sh 62 // $ pulumi import aws:redshift/authenticationProfile:AuthenticationProfile test example 63 // ``` 64 type AuthenticationProfile struct { 65 pulumi.CustomResourceState 66 67 // The content of the authentication profile in JSON format. The maximum length of the JSON string is determined by a quota for your account. 68 AuthenticationProfileContent pulumi.StringOutput `pulumi:"authenticationProfileContent"` 69 // The name of the authentication profile. 70 AuthenticationProfileName pulumi.StringOutput `pulumi:"authenticationProfileName"` 71 } 72 73 // NewAuthenticationProfile registers a new resource with the given unique name, arguments, and options. 74 func NewAuthenticationProfile(ctx *pulumi.Context, 75 name string, args *AuthenticationProfileArgs, opts ...pulumi.ResourceOption) (*AuthenticationProfile, error) { 76 if args == nil { 77 return nil, errors.New("missing one or more required arguments") 78 } 79 80 if args.AuthenticationProfileContent == nil { 81 return nil, errors.New("invalid value for required argument 'AuthenticationProfileContent'") 82 } 83 if args.AuthenticationProfileName == nil { 84 return nil, errors.New("invalid value for required argument 'AuthenticationProfileName'") 85 } 86 opts = internal.PkgResourceDefaultOpts(opts) 87 var resource AuthenticationProfile 88 err := ctx.RegisterResource("aws:redshift/authenticationProfile:AuthenticationProfile", name, args, &resource, opts...) 89 if err != nil { 90 return nil, err 91 } 92 return &resource, nil 93 } 94 95 // GetAuthenticationProfile gets an existing AuthenticationProfile resource's state with the given name, ID, and optional 96 // state properties that are used to uniquely qualify the lookup (nil if not required). 97 func GetAuthenticationProfile(ctx *pulumi.Context, 98 name string, id pulumi.IDInput, state *AuthenticationProfileState, opts ...pulumi.ResourceOption) (*AuthenticationProfile, error) { 99 var resource AuthenticationProfile 100 err := ctx.ReadResource("aws:redshift/authenticationProfile:AuthenticationProfile", name, id, state, &resource, opts...) 101 if err != nil { 102 return nil, err 103 } 104 return &resource, nil 105 } 106 107 // Input properties used for looking up and filtering AuthenticationProfile resources. 108 type authenticationProfileState struct { 109 // The content of the authentication profile in JSON format. The maximum length of the JSON string is determined by a quota for your account. 110 AuthenticationProfileContent *string `pulumi:"authenticationProfileContent"` 111 // The name of the authentication profile. 112 AuthenticationProfileName *string `pulumi:"authenticationProfileName"` 113 } 114 115 type AuthenticationProfileState struct { 116 // The content of the authentication profile in JSON format. The maximum length of the JSON string is determined by a quota for your account. 117 AuthenticationProfileContent pulumi.StringPtrInput 118 // The name of the authentication profile. 119 AuthenticationProfileName pulumi.StringPtrInput 120 } 121 122 func (AuthenticationProfileState) ElementType() reflect.Type { 123 return reflect.TypeOf((*authenticationProfileState)(nil)).Elem() 124 } 125 126 type authenticationProfileArgs struct { 127 // The content of the authentication profile in JSON format. The maximum length of the JSON string is determined by a quota for your account. 128 AuthenticationProfileContent string `pulumi:"authenticationProfileContent"` 129 // The name of the authentication profile. 130 AuthenticationProfileName string `pulumi:"authenticationProfileName"` 131 } 132 133 // The set of arguments for constructing a AuthenticationProfile resource. 134 type AuthenticationProfileArgs struct { 135 // The content of the authentication profile in JSON format. The maximum length of the JSON string is determined by a quota for your account. 136 AuthenticationProfileContent pulumi.StringInput 137 // The name of the authentication profile. 138 AuthenticationProfileName pulumi.StringInput 139 } 140 141 func (AuthenticationProfileArgs) ElementType() reflect.Type { 142 return reflect.TypeOf((*authenticationProfileArgs)(nil)).Elem() 143 } 144 145 type AuthenticationProfileInput interface { 146 pulumi.Input 147 148 ToAuthenticationProfileOutput() AuthenticationProfileOutput 149 ToAuthenticationProfileOutputWithContext(ctx context.Context) AuthenticationProfileOutput 150 } 151 152 func (*AuthenticationProfile) ElementType() reflect.Type { 153 return reflect.TypeOf((**AuthenticationProfile)(nil)).Elem() 154 } 155 156 func (i *AuthenticationProfile) ToAuthenticationProfileOutput() AuthenticationProfileOutput { 157 return i.ToAuthenticationProfileOutputWithContext(context.Background()) 158 } 159 160 func (i *AuthenticationProfile) ToAuthenticationProfileOutputWithContext(ctx context.Context) AuthenticationProfileOutput { 161 return pulumi.ToOutputWithContext(ctx, i).(AuthenticationProfileOutput) 162 } 163 164 // AuthenticationProfileArrayInput is an input type that accepts AuthenticationProfileArray and AuthenticationProfileArrayOutput values. 165 // You can construct a concrete instance of `AuthenticationProfileArrayInput` via: 166 // 167 // AuthenticationProfileArray{ AuthenticationProfileArgs{...} } 168 type AuthenticationProfileArrayInput interface { 169 pulumi.Input 170 171 ToAuthenticationProfileArrayOutput() AuthenticationProfileArrayOutput 172 ToAuthenticationProfileArrayOutputWithContext(context.Context) AuthenticationProfileArrayOutput 173 } 174 175 type AuthenticationProfileArray []AuthenticationProfileInput 176 177 func (AuthenticationProfileArray) ElementType() reflect.Type { 178 return reflect.TypeOf((*[]*AuthenticationProfile)(nil)).Elem() 179 } 180 181 func (i AuthenticationProfileArray) ToAuthenticationProfileArrayOutput() AuthenticationProfileArrayOutput { 182 return i.ToAuthenticationProfileArrayOutputWithContext(context.Background()) 183 } 184 185 func (i AuthenticationProfileArray) ToAuthenticationProfileArrayOutputWithContext(ctx context.Context) AuthenticationProfileArrayOutput { 186 return pulumi.ToOutputWithContext(ctx, i).(AuthenticationProfileArrayOutput) 187 } 188 189 // AuthenticationProfileMapInput is an input type that accepts AuthenticationProfileMap and AuthenticationProfileMapOutput values. 190 // You can construct a concrete instance of `AuthenticationProfileMapInput` via: 191 // 192 // AuthenticationProfileMap{ "key": AuthenticationProfileArgs{...} } 193 type AuthenticationProfileMapInput interface { 194 pulumi.Input 195 196 ToAuthenticationProfileMapOutput() AuthenticationProfileMapOutput 197 ToAuthenticationProfileMapOutputWithContext(context.Context) AuthenticationProfileMapOutput 198 } 199 200 type AuthenticationProfileMap map[string]AuthenticationProfileInput 201 202 func (AuthenticationProfileMap) ElementType() reflect.Type { 203 return reflect.TypeOf((*map[string]*AuthenticationProfile)(nil)).Elem() 204 } 205 206 func (i AuthenticationProfileMap) ToAuthenticationProfileMapOutput() AuthenticationProfileMapOutput { 207 return i.ToAuthenticationProfileMapOutputWithContext(context.Background()) 208 } 209 210 func (i AuthenticationProfileMap) ToAuthenticationProfileMapOutputWithContext(ctx context.Context) AuthenticationProfileMapOutput { 211 return pulumi.ToOutputWithContext(ctx, i).(AuthenticationProfileMapOutput) 212 } 213 214 type AuthenticationProfileOutput struct{ *pulumi.OutputState } 215 216 func (AuthenticationProfileOutput) ElementType() reflect.Type { 217 return reflect.TypeOf((**AuthenticationProfile)(nil)).Elem() 218 } 219 220 func (o AuthenticationProfileOutput) ToAuthenticationProfileOutput() AuthenticationProfileOutput { 221 return o 222 } 223 224 func (o AuthenticationProfileOutput) ToAuthenticationProfileOutputWithContext(ctx context.Context) AuthenticationProfileOutput { 225 return o 226 } 227 228 // The content of the authentication profile in JSON format. The maximum length of the JSON string is determined by a quota for your account. 229 func (o AuthenticationProfileOutput) AuthenticationProfileContent() pulumi.StringOutput { 230 return o.ApplyT(func(v *AuthenticationProfile) pulumi.StringOutput { return v.AuthenticationProfileContent }).(pulumi.StringOutput) 231 } 232 233 // The name of the authentication profile. 234 func (o AuthenticationProfileOutput) AuthenticationProfileName() pulumi.StringOutput { 235 return o.ApplyT(func(v *AuthenticationProfile) pulumi.StringOutput { return v.AuthenticationProfileName }).(pulumi.StringOutput) 236 } 237 238 type AuthenticationProfileArrayOutput struct{ *pulumi.OutputState } 239 240 func (AuthenticationProfileArrayOutput) ElementType() reflect.Type { 241 return reflect.TypeOf((*[]*AuthenticationProfile)(nil)).Elem() 242 } 243 244 func (o AuthenticationProfileArrayOutput) ToAuthenticationProfileArrayOutput() AuthenticationProfileArrayOutput { 245 return o 246 } 247 248 func (o AuthenticationProfileArrayOutput) ToAuthenticationProfileArrayOutputWithContext(ctx context.Context) AuthenticationProfileArrayOutput { 249 return o 250 } 251 252 func (o AuthenticationProfileArrayOutput) Index(i pulumi.IntInput) AuthenticationProfileOutput { 253 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AuthenticationProfile { 254 return vs[0].([]*AuthenticationProfile)[vs[1].(int)] 255 }).(AuthenticationProfileOutput) 256 } 257 258 type AuthenticationProfileMapOutput struct{ *pulumi.OutputState } 259 260 func (AuthenticationProfileMapOutput) ElementType() reflect.Type { 261 return reflect.TypeOf((*map[string]*AuthenticationProfile)(nil)).Elem() 262 } 263 264 func (o AuthenticationProfileMapOutput) ToAuthenticationProfileMapOutput() AuthenticationProfileMapOutput { 265 return o 266 } 267 268 func (o AuthenticationProfileMapOutput) ToAuthenticationProfileMapOutputWithContext(ctx context.Context) AuthenticationProfileMapOutput { 269 return o 270 } 271 272 func (o AuthenticationProfileMapOutput) MapIndex(k pulumi.StringInput) AuthenticationProfileOutput { 273 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AuthenticationProfile { 274 return vs[0].(map[string]*AuthenticationProfile)[vs[1].(string)] 275 }).(AuthenticationProfileOutput) 276 } 277 278 func init() { 279 pulumi.RegisterInputType(reflect.TypeOf((*AuthenticationProfileInput)(nil)).Elem(), &AuthenticationProfile{}) 280 pulumi.RegisterInputType(reflect.TypeOf((*AuthenticationProfileArrayInput)(nil)).Elem(), AuthenticationProfileArray{}) 281 pulumi.RegisterInputType(reflect.TypeOf((*AuthenticationProfileMapInput)(nil)).Elem(), AuthenticationProfileMap{}) 282 pulumi.RegisterOutputType(AuthenticationProfileOutput{}) 283 pulumi.RegisterOutputType(AuthenticationProfileArrayOutput{}) 284 pulumi.RegisterOutputType(AuthenticationProfileMapOutput{}) 285 }