1- package rhel
1+ package windows
22
33import (
44 "github.com/adrianriobo/qenvs/pkg/infra/aws/modules/compute"
@@ -17,55 +17,50 @@ func (r *WindowsRequest) GetAMI(ctx *pulumi.Context) (*ec2.LookupAmiResult, erro
1717 return ami .GetAMIByName (ctx , r .Specs .AMI .RegexName , r .Specs .AMI .Owner , r .Specs .AMI .Filters )
1818}
1919
20- func (r * WindowsRequest ) GetUserdata () (pulumi.StringPtrInput , error ) {
21-
22- // https://charlesxu.io/wiki/infra-as-code/pulumi/
23- // https://www.pulumi.com/registry/packages/random/api-docs/randompassword/?utm_source=performance-max&utm_medium=cpc&utm_campaign=&utm_term=&utm_medium=ppc&utm_source=adwords&hsa_grp=&hsa_cam=18353585506&hsa_mt=&hsa_net=adwords&hsa_ver=3&hsa_acc=1926559913&hsa_ad=&hsa_src=x&hsa_tgt=&hsa_kw=&gclid=EAIaIQobChMIwP3C2sqK-wIVPY1oCR0EOgJoEAAYASAAEgJM6vD_BwE
24- // t := pulumi.All(r.KeyPair.Arn).ApplyT(
25- // func(args []interface{}) string {
26- // return args[0].(string)
27- // }).(pulumi.StringOutput)
28-
29- // return t, nil
30-
31- // st := pulumi.String("lalal")
32-
33- // return st, nil
20+ func (r * WindowsRequest ) GetUserdata (ctx * pulumi.Context ) (pulumi.StringPtrInput , error ) {
3421 return nil , nil
3522}
3623
24+ // func (r *WindowsRequest) GetUserdata(ctx *pulumi.Context) (pulumi.StringPtrInput, error) {
25+ // password, err := utilInfra.CreatePassword(ctx, r.GetName())
26+ // if err != nil {
27+ // return nil, err
28+ // }
29+ // ctx.Export(r.OutputPrivateKey(), password.Result)
30+ // udBase64 := pulumi.All(password.Result, r.PublicKeyOpenssh).ApplyT(
31+ // func(args []interface{}) string {
32+ // password := args[0].(string)
33+ // authorizedKey := args[1].(string)
34+ // userdata, _ := util.Template(
35+ // userDataValues{
36+ // r.Specs.AMI.DefaultUser,
37+ // password,
38+ // authorizedKey},
39+ // fmt.Sprintf("%s-%s", "userdata", r.GetName()),
40+ // userdata)
41+ // return base64.StdEncoding.EncodeToString([]byte(userdata))
42+ // }).(pulumi.StringOutput)
43+ // return udBase64, nil
44+ // }
45+
3746func (r * WindowsRequest ) GetDedicatedHost (ctx * pulumi.Context ) (* ec2.DedicatedHost , error ) {
3847 return nil , nil
3948}
4049
4150func (r * WindowsRequest ) CustomIngressRules () []securityGroup.IngressRules {
42- return nil
51+ return []securityGroup.IngressRules {
52+ securityGroup .RDP_TCP }
4353}
4454
4555func (r * WindowsRequest ) CustomSecurityGroups (ctx * pulumi.Context ) ([]* ec2.SecurityGroup , error ) {
4656 return nil , nil
4757}
4858
49- func (r * WindowsRequest ) GetPostScript () (string , error ) {
59+ func (r * WindowsRequest ) GetPostScript (ctx * pulumi. Context ) (string , error ) {
5060 return "" , nil
5161}
5262
5363func (r * WindowsRequest ) Create (ctx * pulumi.Context ,
5464 computeRequested compute.ComputeRequest ) (* compute.Compute , error ) {
5565 return r .Request .Create (ctx , r )
5666}
57-
58- // var cloudConfig string = `
59- // #cloud-config
60- // rh_subscription:
61- // username: {{.SubscriptionUsername}}
62- // password: {{.SubscriptionPassword}}
63- // auto-attach: true
64- // packages:
65- // - podman
66- // `
67-
68- // type UserDataValues struct {
69- // SubscriptionUsername string
70- // SubscriptionPassword string
71- // }
0 commit comments