billions-judge-9412
02/06/2022, 7:49 PMflaky-beach-82888
02/08/2022, 10:09 PMresource_config = cloudinit.Config("resource", base64_encode=False,
gzip=False,
parts=[cloudinit.GetConfigPartArgs(
content="baz",
content_type="text/cloud-config",
filename="cloudinit/test.yaml",
)])
node0 = hcloud.Server(
get_name('node'),
image=image,
location=location,
server_type=server_type,
ssh_keys=[default_ssh.id],
user_data=resource_config
)
cloudinit file - taken from cloudinit docu
#cloud-config
# run commands
# default: none
# runcmd contains a list of either lists or a string
# each item will be executed in order at rc.local like level with
# output to the console
# - runcmd only runs during the first boot
# - if the item is a list, the items will be properly executed as if
# passed to execve(3) (with the first arg as the command).
# - if the item is a string, it will be simply written to the file and
# will be interpreted by 'sh'
#
# Note, that the list has to be proper yaml, so you have to quote
# any characters yaml would eat (':' can be problematic)
runcmd:
- [ ls, -l, / ]
- [ sh, -xc, "echo $(date) ': hello world!'" ]
- [ sh, -c, echo "=========hello world'=========" ]
- ls -l /root
# Note: Don't write files to /tmp from cloud-init use /run/somedir instead.
# Early boot environments can race systemd-tmpfiles-clean LP: #1707222.
- mkdir /run/mydir
- [ wget, "<http://slashdot.org>", -O, /run/mydir/index.html ]
pulumi up runs through without errors, but cloud init is not applied. -> directory /run/mydir does not exists.
edit:
I use hetzner cloud, user_data should be supported according to pulumi doc.gentle-school-19497
02/09/2022, 12:01 AMgreat-sunset-355
02/10/2022, 9:40 AMhallowed-scooter-78375
02/10/2022, 10:42 AMclever-glass-42863
02/12/2022, 12:04 AMEnvs = new Input<string>[]
{
// Analytics DB...
"ANALYTICS_DB_USERNAME=postgres",
"ANALYTICS_DB_PASSWORD=password",
analyticsPostgresHostname,
// Accounts DB...
"ACCOUNTS_DB_USERNAME=postgres",
"ACCOUNTS_DB_PASSWORD=password",
accountsPostgresHostname,
"ACCOUNTS_DB_PORT=5432",
"ANALYTICS_DB_PORT=5431",
"PORT=80"
},
Where both the analyticsPostgresHostname
and accountsPostgresHostname
are defined like:
var accountsPostgresHostname = accountsPostgresContainer.Hostname.Apply(networkName => $"ACCOUNTS_DB_HOSTNAME={networkName}");
var analyticsPostgresHostname = analyticsPostgresContainer.Hostname.Apply(networkName => $"ANALYTICS_DB_HOSTNAME={networkName}");
However, only one of those hostnames actually get filled, the other is an empty string. Is it expected that both those Output<string> be resolved in that Input<string>[]? I appreciate your time!quaint-pillow-20530
02/13/2022, 8:18 PMvictorious-wall-1075
02/15/2022, 2:47 PMns = Namespace(kwargs["namespace"], metadata={"name": kwargs["namespace"]})
This works when the namespace does not exist. It fails with “already exists” if the namespace exists.
+ pulumi:pulumi:Stack pulumi-iac-k8-deploy-heml-rmjbpcxuer creating
+ kubernetes:core/v1:Namespace iac-test creating
+ kubernetes:core/v1:Namespace iac-test creating Retry #0; creation failed: namespaces "iac-test" already exists
How do I change this code so that Namespace is created only if it doesn’t exist. ? I am looking at the docs but cannot find an option to do this..
Help appreciated..hallowed-quill-52018
02/15/2022, 4:03 PMsilly-evening-40761
02/16/2022, 4:51 PMfast-ability-28628
02/16/2022, 10:02 PMbreezy-helicopter-33703
02/17/2022, 6:12 AMfuture-cartoon-6373
02/18/2022, 12:41 PMlittle-library-54601
02/21/2022, 7:35 PMlittle-library-54601
02/21/2022, 9:28 PMrapid-football-44318
02/23/2022, 8:40 AM##[debug] stack
##[debug] select
##[debug] myorganisation/bg/dev
/home/vsts/work/_temp/01d522e5-8d36-46cb-863b-4387991ea26a/pulumi/pulumi stack select myorganisation/bg/dev
##[debug]task result: Failed
##[error]Error: There was an error when attempting to execute the process '/home/vsts/work/_temp/01d522e5-8d36-46cb-863b-4387991ea26a/pulumi/pulumi'. This may indicate the process failed to start. Error: spawn /home/vsts/work/_temp/01d522e5-8d36-46cb-863b-4387991ea26a/pulumi/pulumi ENOENT
##[debug]Processed: ##vso[task.issue type=error;]Error: There was an error when attempting to execute the process '/home/vsts/work/_temp/01d522e5-8d36-46cb-863b-4387991ea26a/pulumi/pulumi'. This may indicate the process failed to start. Error: spawn /home/vsts/work/_temp/01d522e5-8d36-46cb-863b-4387991ea26a/pulumi/pulumi ENOENT
It looks like it fails on the 'select stack', but this is fine in the preview and is identical.
The YAML looks like
# Infrastructure Build and Deploy
variables:
- template: /pipelines/variables/common-vars.yml
- template: /pipelines/variables/bg/common-vars.yml
- group: Core-Variables
trigger:
batch: true
branches:
include:
- main
paths:
include:
- 'infrastructure/bg/**/*'
name: $(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
stages:
- stage: DEV
displayName: Deploy to DEV
variables:
- template: /pipelines/variables/common-vars-dev.yml
- template: /pipelines/variables/bg/dev-vars.yml
- group: KeyVault-BG-Dev
jobs:
- job: PreviewInfra
displayName: Pulumi Preview
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NuGetToolInstaller@1
- task: Pulumi@1
condition: or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.Reason'], 'Manual'))
inputs:
azureSubscription: '${{ variables.AzureSubscriptionConnection }}'
command: 'preview'
cwd: '$(pulumiWorkingDirectory)'
stack: '$(pulumiStackName)'
- job: ManualIntervention
dependsOn: PreviewInfra
condition: and(succeeded('PreviewInfra'), ne(variables['Build.Reason'], 'PullRequest'))
displayName: Manual Cross Check of Preview
pool: server
steps:
- task: ManualValidation@0
inputs:
notifyUsers: '<mailto:me@somewhere.com|me@somewhere.com>'
instructions: 'Cross check and Review the Pulumi Preview step and if appropriate approve.'
- deployment: DeployInfra
dependsOn: ManualIntervention
displayName: Pulumi Up
pool:
vmImage: 'ubuntu-latest'
environment: ${{ variables.DevOpsEnvName }}
strategy:
runOnce:
deploy:
steps:
- task: NuGetToolInstaller@1
- task: Pulumi@1
inputs:
azureSubscription: '${{ variables.AzureSubscriptionConnection }}'
command: 'up'
cwd: '$(pulumiWorkingDirectory)'
stack: '$(pulumiStackName)'
args: '--yes'
rapid-football-44318
02/23/2022, 11:38 PMcheckout: self
to the job prior to the pulumi task.
see https://docs.microsoft.com/en-us/azure/devops/pipelines/process/deployment-jobs?view=azure-devopslittle-library-54601
02/24/2022, 3:50 PMchilly-plastic-75584
02/24/2022, 6:51 PMcreamy-fall-88031
02/24/2022, 11:29 PM{
"error": {
"code": "AuthenticationFailed",
"message": "Authentication failed. The 'Authorization' header is missing."
}
}
Anyone with an idea what I might be doing wrong?bored-coat-16933
02/25/2022, 8:27 AMbulky-bird-93072
02/26/2022, 3:08 PMwet-carpenter-14925
03/02/2022, 4:02 PMvenv
created by pulumi new
, and it also doesn't have documentation for the pulumi modules. Does anyone have experience getting these set up?alert-zebra-27114
03/02/2022, 8:58 PMgifted-artist-72219
03/03/2022, 7:55 AMconst EventRule = new aws.cloudwatch.EventRule("testpulumi", {
eventBusName: "default",
isEnabled: true,
name: "testpulumi",
description: "Get scheduled events for EC2 instance",
eventPattern: `{
"source": ["aws.health"],
"detail-type": ["AWS Health Event"],
"detail": {
"service": ["EC2"],
"eventTypeCategory": ["scheduledChange"]
}
}`,
});
bright-oil-46290
03/06/2022, 3:42 AMbright-oil-46290
03/06/2022, 3:43 AMbright-oil-46290
03/07/2022, 6:02 AMabundant-book-94104
03/07/2022, 11:18 PMbright-oil-46290
03/08/2022, 12:36 AM