github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/opsworks/userProfile.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 opsworks 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 // Provides an OpsWorks User Profile resource. 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opsworks" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := opsworks.NewUserProfile(ctx, "my_profile", &opsworks.UserProfileArgs{ 33 // UserArn: pulumi.Any(user.Arn), 34 // SshUsername: pulumi.String("my_user"), 35 // }) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 type UserProfile struct { 46 pulumi.CustomResourceState 47 48 // Whether users can specify their own SSH public key through the My Settings page 49 AllowSelfManagement pulumi.BoolPtrOutput `pulumi:"allowSelfManagement"` 50 // The users public key 51 SshPublicKey pulumi.StringPtrOutput `pulumi:"sshPublicKey"` 52 // The ssh username, with witch this user wants to log in 53 SshUsername pulumi.StringOutput `pulumi:"sshUsername"` 54 // The user's IAM ARN 55 UserArn pulumi.StringOutput `pulumi:"userArn"` 56 } 57 58 // NewUserProfile registers a new resource with the given unique name, arguments, and options. 59 func NewUserProfile(ctx *pulumi.Context, 60 name string, args *UserProfileArgs, opts ...pulumi.ResourceOption) (*UserProfile, error) { 61 if args == nil { 62 return nil, errors.New("missing one or more required arguments") 63 } 64 65 if args.SshUsername == nil { 66 return nil, errors.New("invalid value for required argument 'SshUsername'") 67 } 68 if args.UserArn == nil { 69 return nil, errors.New("invalid value for required argument 'UserArn'") 70 } 71 opts = internal.PkgResourceDefaultOpts(opts) 72 var resource UserProfile 73 err := ctx.RegisterResource("aws:opsworks/userProfile:UserProfile", name, args, &resource, opts...) 74 if err != nil { 75 return nil, err 76 } 77 return &resource, nil 78 } 79 80 // GetUserProfile gets an existing UserProfile resource's state with the given name, ID, and optional 81 // state properties that are used to uniquely qualify the lookup (nil if not required). 82 func GetUserProfile(ctx *pulumi.Context, 83 name string, id pulumi.IDInput, state *UserProfileState, opts ...pulumi.ResourceOption) (*UserProfile, error) { 84 var resource UserProfile 85 err := ctx.ReadResource("aws:opsworks/userProfile:UserProfile", name, id, state, &resource, opts...) 86 if err != nil { 87 return nil, err 88 } 89 return &resource, nil 90 } 91 92 // Input properties used for looking up and filtering UserProfile resources. 93 type userProfileState struct { 94 // Whether users can specify their own SSH public key through the My Settings page 95 AllowSelfManagement *bool `pulumi:"allowSelfManagement"` 96 // The users public key 97 SshPublicKey *string `pulumi:"sshPublicKey"` 98 // The ssh username, with witch this user wants to log in 99 SshUsername *string `pulumi:"sshUsername"` 100 // The user's IAM ARN 101 UserArn *string `pulumi:"userArn"` 102 } 103 104 type UserProfileState struct { 105 // Whether users can specify their own SSH public key through the My Settings page 106 AllowSelfManagement pulumi.BoolPtrInput 107 // The users public key 108 SshPublicKey pulumi.StringPtrInput 109 // The ssh username, with witch this user wants to log in 110 SshUsername pulumi.StringPtrInput 111 // The user's IAM ARN 112 UserArn pulumi.StringPtrInput 113 } 114 115 func (UserProfileState) ElementType() reflect.Type { 116 return reflect.TypeOf((*userProfileState)(nil)).Elem() 117 } 118 119 type userProfileArgs struct { 120 // Whether users can specify their own SSH public key through the My Settings page 121 AllowSelfManagement *bool `pulumi:"allowSelfManagement"` 122 // The users public key 123 SshPublicKey *string `pulumi:"sshPublicKey"` 124 // The ssh username, with witch this user wants to log in 125 SshUsername string `pulumi:"sshUsername"` 126 // The user's IAM ARN 127 UserArn string `pulumi:"userArn"` 128 } 129 130 // The set of arguments for constructing a UserProfile resource. 131 type UserProfileArgs struct { 132 // Whether users can specify their own SSH public key through the My Settings page 133 AllowSelfManagement pulumi.BoolPtrInput 134 // The users public key 135 SshPublicKey pulumi.StringPtrInput 136 // The ssh username, with witch this user wants to log in 137 SshUsername pulumi.StringInput 138 // The user's IAM ARN 139 UserArn pulumi.StringInput 140 } 141 142 func (UserProfileArgs) ElementType() reflect.Type { 143 return reflect.TypeOf((*userProfileArgs)(nil)).Elem() 144 } 145 146 type UserProfileInput interface { 147 pulumi.Input 148 149 ToUserProfileOutput() UserProfileOutput 150 ToUserProfileOutputWithContext(ctx context.Context) UserProfileOutput 151 } 152 153 func (*UserProfile) ElementType() reflect.Type { 154 return reflect.TypeOf((**UserProfile)(nil)).Elem() 155 } 156 157 func (i *UserProfile) ToUserProfileOutput() UserProfileOutput { 158 return i.ToUserProfileOutputWithContext(context.Background()) 159 } 160 161 func (i *UserProfile) ToUserProfileOutputWithContext(ctx context.Context) UserProfileOutput { 162 return pulumi.ToOutputWithContext(ctx, i).(UserProfileOutput) 163 } 164 165 // UserProfileArrayInput is an input type that accepts UserProfileArray and UserProfileArrayOutput values. 166 // You can construct a concrete instance of `UserProfileArrayInput` via: 167 // 168 // UserProfileArray{ UserProfileArgs{...} } 169 type UserProfileArrayInput interface { 170 pulumi.Input 171 172 ToUserProfileArrayOutput() UserProfileArrayOutput 173 ToUserProfileArrayOutputWithContext(context.Context) UserProfileArrayOutput 174 } 175 176 type UserProfileArray []UserProfileInput 177 178 func (UserProfileArray) ElementType() reflect.Type { 179 return reflect.TypeOf((*[]*UserProfile)(nil)).Elem() 180 } 181 182 func (i UserProfileArray) ToUserProfileArrayOutput() UserProfileArrayOutput { 183 return i.ToUserProfileArrayOutputWithContext(context.Background()) 184 } 185 186 func (i UserProfileArray) ToUserProfileArrayOutputWithContext(ctx context.Context) UserProfileArrayOutput { 187 return pulumi.ToOutputWithContext(ctx, i).(UserProfileArrayOutput) 188 } 189 190 // UserProfileMapInput is an input type that accepts UserProfileMap and UserProfileMapOutput values. 191 // You can construct a concrete instance of `UserProfileMapInput` via: 192 // 193 // UserProfileMap{ "key": UserProfileArgs{...} } 194 type UserProfileMapInput interface { 195 pulumi.Input 196 197 ToUserProfileMapOutput() UserProfileMapOutput 198 ToUserProfileMapOutputWithContext(context.Context) UserProfileMapOutput 199 } 200 201 type UserProfileMap map[string]UserProfileInput 202 203 func (UserProfileMap) ElementType() reflect.Type { 204 return reflect.TypeOf((*map[string]*UserProfile)(nil)).Elem() 205 } 206 207 func (i UserProfileMap) ToUserProfileMapOutput() UserProfileMapOutput { 208 return i.ToUserProfileMapOutputWithContext(context.Background()) 209 } 210 211 func (i UserProfileMap) ToUserProfileMapOutputWithContext(ctx context.Context) UserProfileMapOutput { 212 return pulumi.ToOutputWithContext(ctx, i).(UserProfileMapOutput) 213 } 214 215 type UserProfileOutput struct{ *pulumi.OutputState } 216 217 func (UserProfileOutput) ElementType() reflect.Type { 218 return reflect.TypeOf((**UserProfile)(nil)).Elem() 219 } 220 221 func (o UserProfileOutput) ToUserProfileOutput() UserProfileOutput { 222 return o 223 } 224 225 func (o UserProfileOutput) ToUserProfileOutputWithContext(ctx context.Context) UserProfileOutput { 226 return o 227 } 228 229 // Whether users can specify their own SSH public key through the My Settings page 230 func (o UserProfileOutput) AllowSelfManagement() pulumi.BoolPtrOutput { 231 return o.ApplyT(func(v *UserProfile) pulumi.BoolPtrOutput { return v.AllowSelfManagement }).(pulumi.BoolPtrOutput) 232 } 233 234 // The users public key 235 func (o UserProfileOutput) SshPublicKey() pulumi.StringPtrOutput { 236 return o.ApplyT(func(v *UserProfile) pulumi.StringPtrOutput { return v.SshPublicKey }).(pulumi.StringPtrOutput) 237 } 238 239 // The ssh username, with witch this user wants to log in 240 func (o UserProfileOutput) SshUsername() pulumi.StringOutput { 241 return o.ApplyT(func(v *UserProfile) pulumi.StringOutput { return v.SshUsername }).(pulumi.StringOutput) 242 } 243 244 // The user's IAM ARN 245 func (o UserProfileOutput) UserArn() pulumi.StringOutput { 246 return o.ApplyT(func(v *UserProfile) pulumi.StringOutput { return v.UserArn }).(pulumi.StringOutput) 247 } 248 249 type UserProfileArrayOutput struct{ *pulumi.OutputState } 250 251 func (UserProfileArrayOutput) ElementType() reflect.Type { 252 return reflect.TypeOf((*[]*UserProfile)(nil)).Elem() 253 } 254 255 func (o UserProfileArrayOutput) ToUserProfileArrayOutput() UserProfileArrayOutput { 256 return o 257 } 258 259 func (o UserProfileArrayOutput) ToUserProfileArrayOutputWithContext(ctx context.Context) UserProfileArrayOutput { 260 return o 261 } 262 263 func (o UserProfileArrayOutput) Index(i pulumi.IntInput) UserProfileOutput { 264 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UserProfile { 265 return vs[0].([]*UserProfile)[vs[1].(int)] 266 }).(UserProfileOutput) 267 } 268 269 type UserProfileMapOutput struct{ *pulumi.OutputState } 270 271 func (UserProfileMapOutput) ElementType() reflect.Type { 272 return reflect.TypeOf((*map[string]*UserProfile)(nil)).Elem() 273 } 274 275 func (o UserProfileMapOutput) ToUserProfileMapOutput() UserProfileMapOutput { 276 return o 277 } 278 279 func (o UserProfileMapOutput) ToUserProfileMapOutputWithContext(ctx context.Context) UserProfileMapOutput { 280 return o 281 } 282 283 func (o UserProfileMapOutput) MapIndex(k pulumi.StringInput) UserProfileOutput { 284 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UserProfile { 285 return vs[0].(map[string]*UserProfile)[vs[1].(string)] 286 }).(UserProfileOutput) 287 } 288 289 func init() { 290 pulumi.RegisterInputType(reflect.TypeOf((*UserProfileInput)(nil)).Elem(), &UserProfile{}) 291 pulumi.RegisterInputType(reflect.TypeOf((*UserProfileArrayInput)(nil)).Elem(), UserProfileArray{}) 292 pulumi.RegisterInputType(reflect.TypeOf((*UserProfileMapInput)(nil)).Elem(), UserProfileMap{}) 293 pulumi.RegisterOutputType(UserProfileOutput{}) 294 pulumi.RegisterOutputType(UserProfileArrayOutput{}) 295 pulumi.RegisterOutputType(UserProfileMapOutput{}) 296 }