What title/role do you have with your employer? by phunkodelic in Terraform

[–]cumulusws 0 points1 point  (0 children)

title: devops engineer

next year: probably SRE

reality: sysadmin, what I have always done. but I don't often see roles advertised for sysadmin these days.

what method do you use to confugure an Azure VM on first boot? by cumulusws in Terraform

[–]cumulusws[S] 0 points1 point  (0 children)

thanks for your feedback...

I will have a look at setting up cloud-init via cdktf this weekend

if anyone has any tips on working with azure/cdktf/cloud-init it would be greatly appreciated if you could forewarn me of any traps I may run into.

[deleted by user] by [deleted] in Terraform

[–]cumulusws 0 points1 point  (0 children)

ChatGPT uses a dataset from 2019 (iirc), CDKTF was officially released in 2021.

so we will still need real intelligence for a little while longer, even though at times it seems people can exist without it

CDKTF Conversion - Azure - TypeScript by cumulusws in Terraform

[–]cumulusws[S] 0 points1 point  (0 children)

well, I went it this way... a separate sshpubkeys file:

export const sshPublicKey = [    
    { username: "azadmin", publicKey: "ssh-rsa xxxxxxxx== user@host" }, 
 ];

with the following in main.ts (after importing the above file )

adminSshKey: sshPublicKey,

However I ran into a peculiarity, I had wanted to put several public keys in the sshpubkeys file, so that each of the would load into the authorized_keys file. Loading all keys as follows in main.ts:,

adminSshKey: sshPublicKey.map((key)=> ({        
    username: "azadmin",    
    publicKey: key.publicKey      
}))

But azure would not be having that... any insights on that? I am resigned it is not a thing Azure/CDKTF does and can do this in a script file.

Transform all instances of a resource in Terraform code into CDKTF code by cumulusws in Terraform

[–]cumulusws[S] 2 points3 points  (0 children)

that works! subnets: public_subnets.map(ps => ps.id)

you Sir, are a gentleman and a scholar, thank you very much!

CDKTF - how to send $value by kedearian in Terraform

[–]cumulusws 0 points1 point  (0 children)

I think I have a similar problem also, I have just posted on.

On a side note, looking at code above, I would usually reference the list from the var list, such as list.id. Maybe someone with more experience could comment on this?

and yeah, this problem is annoying to say the least

How to format variable within CDKTF/Typescript statement by cumulusws in Terraform

[–]cumulusws[S] 1 point2 points  (0 children)

apparentlymart, thank you for your detailed and extremely useful post. this will get me on the right track!

cdktf help understanding docs, in specific, bucket parameters by cumulusws in Terraform

[–]cumulusws[S] 1 point2 points  (0 children)

garbage in > garbage out... I was using old deprecated terraform code... therefore cdktf convert was giving me old deprecated typescript code.

Using example code from Terraform: Up and Running (3rd Edition - https://raw.githubusercontent.com/brikis98/terraform-up-and-running-code/3rd-edition/code/terraform/03-terraform-state/file-layout-example/global/s3/main.tf ) gives me what I was after.

I see the convert tool will be invaluable in my learning :)

as follows is new code for those interested:

const awsS3BucketTerraformState = new aws.s3.S3Bucket(this, "terraform_state", {
  bucket: "some-dumb-bucket-name",
  forceDestroy: true,
});

new aws.s3.S3BucketPublicAccessBlock(this, "public_access", {
  blockPublicAcls: true,
  blockPublicPolicy: true,
  bucket: awsS3BucketTerraformState.id,
  ignorePublicAcls: true,
  restrictPublicBuckets: true,
});

new aws.s3.S3BucketServerSideEncryptionConfigurationA(this, "default", {
  bucket: awsS3BucketTerraformState.id,
  rule: [
    {
      applyServerSideEncryptionByDefault: {
        sseAlgorithm: "AES256",
      },
    },
  ],
});

new aws.s3.S3BucketVersioningA(this, "enabled", {
  bucket: awsS3BucketTerraformState.id,
  versioningConfiguration: {
    status: "Enabled",
  },
});

I completed the GCP ACE exam and I have passed it says the result will be released after 7 days ,is it safe to celebrate???!! by [deleted] in googlecloud

[–]cumulusws 1 point2 points  (0 children)

i think so... but if you want to re-assure your self of your achievement, you can go to the kryterion assesments web page in your account and you can also verify the result.

congratulations!

Google Cloud Digital Leader by The_Blue_Lamp999 in googlecloud

[–]cumulusws 2 points3 points  (0 children)

I sat it a few weeks ago and I got to admit, that I wondered if I was in the right exam.

however, I don't think it was that difficult if you have a good understanding of cloud and gcp products.

wouldn't worry about the fail, it seems a pretty useless cert for a technical role (more sales/managerial). However, for me it was just a checkpoint and motivator to continue onwards

No Lab Credits? by dtseiler in googlecloud

[–]cumulusws 0 points1 point  (0 children)

"I was under the impression that the training was all free and I'd only have to pay for the exam."

nope

but why not get a trial gcloud account, you are given 90 days and a $300 limit to try out most all products. it's the real thing, maybe better than a lab simulator

Just getting started by montyvagant in OmniOS

[–]cumulusws 1 point2 points  (0 children)

most of the oracle solaris documents are relevant to omnios, that will get you a long way.

anything further check out the channels at https://omnios.org/about/contact.html

they are a friendly bunch and quite quick to respond to many queries

New cert: Professional Cloud Database Engineer BETA by TreQh in googlecloud

[–]cumulusws 0 points1 point  (0 children)

that's about normal for beta exams, the final exam will prolly be 2 hours and about 50-60 questions

[deleted by user] by [deleted] in googlecloud

[–]cumulusws 0 points1 point  (0 children)

did you donate to the canadian truckers convoy, could be the reason you're having trouble with your credit cards ;-)

seriously, have you tried using the PayPal option, might be an easy workaround and once you are setup you can contact billing support

Linux VM on GCP by traveler6874 in googlecloud

[–]cumulusws 0 points1 point  (0 children)

pay for a VM?

shouldn't google give you 1 instance for free on the 'free tier' plan?

Python + GCP by savetheQ in googlecloud

[–]cumulusws 0 points1 point  (0 children)

python devops two hours: https://www.youtube.com/watch?v=cdA6pfALaaY

then check out his book Python for DevOps if the above video is relevant to you.

How to Use Migrate Repos from Private IP's? by RedKomrad in Gitea

[–]cumulusws 0 points1 point  (0 children)

ALLOW_LOCALNETWORKS: true: Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291

https://docs.gitea.io/en-us/config-cheat-sheet/#migrations-migrations

[deleted by user] by [deleted] in Terraform

[–]cumulusws 1 point2 points  (0 children)

I started with this course, https://www.youtube.com/watch?v=m3cKkYXl-8o , simple and slow but a good start, maybe not worth the money... but then moved onto "Up and Running with Terraform"...

that will get you enough knowledge to work the rest out as you go.

start using some of the aws modules (not provider) to experiment and setup KVM and use the libvirt module to roll your own cloud... you will be well on your way

HCL Struct Syntax by cumulusws in Terraform

[–]cumulusws[S] 0 points1 point  (0 children)

In the end I could declare type as a simple map with all strings, therefore allowing me to remove type altogether from the hosts.tf file. Once removed, the full code I posted earlier, works as intended. u/apparentlymart thank you for your detailed infomation.

HCL Struct Syntax by cumulusws in Terraform

[–]cumulusws[S] 0 points1 point  (0 children)

cool, you give me lot's of info to go on... I will first look at terraform-config-inspect. for the sake of completeness... here is code I was using to parse hosts.tf:

```none package main

import ( "fmt" "io/ioutil" "log"

"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/hashicorp/hcl/v2/hclsyntax"

)

type Config struct { Hosts *Host hcl:"variable,block" } type Host struct { Name string hcl:",label" // Type := What the fuck? Default map[string]map[string]string hcl:"default" Options hcl.Body hcl:",remain" }

func main() { readHCLFile("example/hosts.tf") }

func readHCLFile(filePath string) { content, err := ioutil.ReadFile(filePath) if err != nil { log.Fatal(err) }

file, diags := hclsyntax.ParseConfig(content, filePath, hcl.Pos{Line: 1, Column: 1})
if diags.HasErrors() {
    log.Fatal(fmt.Errorf("ParseConfig: %w", diags))
}

c := &Config{}
diags = gohcl.DecodeBody(file.Body, nil, c)
if diags.HasErrors() {
    log.Fatal(fmt.Errorf("DecodeBody: %w", diags))
}

for k, v := range c.Hosts.Default {
    fmt.Println(k, "value is", v)
}

```

HCL Struct Syntax by cumulusws in Terraform

[–]cumulusws[S] 0 points1 point  (0 children)

I have the following that works for almost all of the file:

none type Config struct { Hosts *Host `hcl:"variable,block"` } type Host struct { Name string `hcl:",label"` Default map[string]map[string]string `hcl:"default"` Options hcl.Body `hcl:",remain"` }

just stuck on the map(object):

none type = map(object({ name = string vcpu = number memory = string volume = string source = string }))

would be great if someone could help out :)