clever-glass-42863
04/04/2022, 9:57 PMpulumi up
command into the dotnet Program itself? Are all the extra command line arguments passed through passively? Or will we need to do something else to do that; for example just rely on environment variables.
internal class Program
{
static Task<int> Main()
{
// I want to parse command-line args here, but does pulumi up pass them through?
// Or just use Environment variables?
return Deployment.RunAsync<MyCoolStack>();
}
}
quick-wolf-8403
04/05/2022, 4:54 PMpackage.json
etc, having pulumi up
in an 'npm run' script?
2. Or, am I best just having it exist in a subdirectory and forcing devs to set up the dependencies (npm i again in the subdir, or a Python venv, or install Go, etc)
What's possible, and what's the best practice?happy-exabyte-28607
04/05/2022, 6:31 PMhappy-exabyte-28607
04/05/2022, 6:32 PMchilly-plastic-75584
04/05/2022, 6:41 PMrough-oyster-77458
04/05/2022, 7:11 PMpulumi up
, I see this error message:
error: deleting urn:pulumi:dev::data::gcp:bigquery/dataset:Dataset$gcp:bigquery/table:Table::my_dataset.my_table: 1 error occurred:
* cannot destroy instance without setting deletion_protection=false and running `terraform apply`
I changes some resource options:
opts=pl.ResourceOptions(
parent=dataset_raw,
delete_before_replace=True,
protect=False,
)
But the error has not been dissapeared.
What did I do wrong? How to fix that?gifted-answer-39386
04/06/2022, 1:34 PMaws
using aws-native
package.
I have successfully imported a single resource (s3 bucket), but it was imported without the PublicAccessBlockConfiguration
.
My infra was created using cloudformation
, so I would like keep the same syntax and API.
How can I import my resources using aws-native
?chilly-plastic-75584
04/06/2022, 6:32 PMstocky-butcher-62635
04/07/2022, 8:19 AMstocky-butcher-62635
04/07/2022, 9:02 AMstocky-butcher-62635
04/07/2022, 9:45 AM> az login
A web browser has been opened at <https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize>. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.
[
{
"cloudName": "AzureCloud",
"homeTenantId": "...",
"id": "...",
"isDefault": true,
"managedByTenants": [],
"name": "Azure Subscription",
"state": "Enabled",
"tenantId": "...",
"user": {
"name": "richardb@...",
"type": "user"
}
}
]
> pulumi login
Logged in to <http://pulumi.com|pulumi.com> as ... (<https://app.pulumi.com/...>)
warning: A new version of Pulumi is available. To upgrade from version '3.27.0' to '3.28.0', run
> powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('<https://get.pulumi.com/install.ps1'))>"
or visit <https://pulumi.com/docs/reference/install/> for manual instructions and release notes.
> mkdir Pulumi
> cd Pulumi
> pulumi new csharp
This command will walk you through creating a new Pulumi project.
Enter a value or leave blank to accept the (default), and press <ENTER>.
Press ^C at any time to quit.
project name: (Pulumi2) RwbTestProject
project description: (A minimal C# Pulumi program) RWB's test project
Created project 'RwbTestProject'
Please enter your desired stack name.
To create a stack in an organization, use the format <org-name>/<stack-name> (e.g. `acmecorp/dev`).
stack name: (dev) rwb-test-stack
Created stack 'rwb-test-stack'
Installing dependencies...
running 'dotnet build -nologo .'
Determining projects to restore...
Restored C:\Work\Pulumi\RwbTestProject.csproj (in 1.5 sec).
RwbTestProject -> C:\Work\Pulumi\bin\Debug\netcoreapp3.1\RwbTestProject.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:03.23
'dotnet build -nologo .' completed successfully
Finished installing dependencies
Your new project is ready to go!
To perform an initial deployment, run 'pulumi up'
warning: A new version of Pulumi is available. To upgrade from version '3.27.0' to '3.28.0', run
> powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('<https://get.pulumi.com/install.ps1'))>"
or visit <https://pulumi.com/docs/reference/install/> for manual instructions and release notes.
> REM A new thing has now appeared in the Pulumi website.
stocky-butcher-62635
04/07/2022, 10:00 AMpulumi destroy
seems to be for stacks not projects? And I deleted the yml
file already.stocky-butcher-62635
04/07/2022, 10:04 AMproject.stack.yml
file but there isn't.stocky-butcher-62635
04/07/2022, 11:08 AMMyStack.cs
. Presumably there should be one for every stack?stocky-butcher-62635
04/07/2022, 11:14 AMpulumi new azure-csharp
rather than just csharp
?stocky-butcher-62635
04/07/2022, 11:23 AMstocky-butcher-62635
04/07/2022, 12:54 PMazure-csharp
does create a .stack.yml
Have to remove any custom NuGet feeds from NuGet.conf
because it only works with <http://nuget.org|nuget.org>
stocky-butcher-62635
04/07/2022, 1:57 PMstocky-butcher-62635
04/07/2022, 2:00 PMpulumi stack init staging
then it doesn't add a new yml file.
And if I add a yml file then no new pink blob appears in the websitestocky-butcher-62635
04/07/2022, 2:00 PMstocky-butcher-62635
04/07/2022, 2:25 PMstocky-butcher-62635
04/07/2022, 2:25 PMstocky-butcher-62635
04/07/2022, 2:51 PMgreat-queen-39697
04/07/2022, 3:09 PMstocky-butcher-62635
04/08/2022, 8:32 AM*
mean?stocky-butcher-62635
04/08/2022, 3:26 PMyml
file for the environment
RwbPulumiProject:ApplicationName: rwb
(Apparently each setting key must be of the form a:b
The documentation page https://www.pulumi.com/docs/intro/concepts/config/ implies that the first bit is not required but apparently this is untrue.)
Then I try to use it
Config config = new Pulumi.Config();
string applicationName = config.Require("RwbPulumiProject:ApplicationName");
(Is is possible to rename the class from MyStack
? My* really makes my skin crawl.)
But then
C:\Work\Azure\RwbPulumiProject>pulumi up
Previewing update (dev)
View Live: <https://app.pulumi.com/jayallcock/RwbPulumiProject/dev/previews/a321fb21-a32a-4b5d-bd30-61c0e6e68c94>
Type Name Plan Info
+ pulumi:pulumi:Stack RwbPulumiProject-dev create 1 error
Diagnostics:
pulumi:pulumi:Stack (RwbPulumiProject-dev):
error: Running program 'C:\Work\Azure\RwbPulumiProject\bin\Debug\netcoreapp3.1\RwbPulumiProject.dll' failed with an unhandled exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at object RuntimeTypeHandle.CreateInstance(RuntimeType type, bool publicOnly, bool wrapExceptions, ref bool canBeCached, ref RuntimeMethodHandleInternal ctor, ref bool hasNoDefaultCtor)
at object RuntimeType.CreateInstanceDefaultCtorSlow(bool publicOnly, bool wrapExceptions, bool fillCache)
at object RuntimeType.CreateInstanceDefaultCtor(bool publicOnly, bool skipCheckThis, bool fillCache, bool wrapExceptions)
at T Activator.CreateInstance<T>()
at Task<int> Pulumi.Deployment+Runner.Pulumi.IRunner.RunAsync<TStack>(IServiceProvider serviceProvider)+() => { }
at Task<int> Pulumi.Deployment+Runner.RunAsync<TStack>(Func<TStack> stackFactory) ---> Pulumi.Config+ConfigMissingException: Missing Required configuration variable 'RwbPulumiProject:RwbPulumiProject:ApplicationName'
please set a value using the command `pulumi config set RwbPulumiProject:RwbPulumiProject:ApplicationName <value>`
at string Pulumi.Config.RequireImpl(string key, string use, string insteadOf)
at string Pulumi.Config.Require(string key)
at new MyStack() in C:/Work/Azure/RwbPulumiProject/MyStack.cs:line 17
--- End of inner exception stack trace ---
C:\Work\Azure\RwbPulumiProject>
stocky-butcher-62635
04/08/2022, 3:28 PMstocky-butcher-62635
04/08/2022, 4:18 PMup
fails then it doesn't roll back and you need to go into the Azure website to work out what happened and clean up?limited-fish-67957
04/08/2022, 4:32 PMpulumi
is the my node_modules are not getting uploaded to aws lambda
. I was wondering if anyone has solved this or point me to some kind of solution of uploading the node-modules
as my serverless
function keeps giving me module not found error
broad-fall-19241
04/08/2022, 7:24 PMup
got interrupted (can’t recall if it was a network error or if I cancelled w/ Ctrl + C
). This, of course, left some pending_operations
in the state that prevent the use of up
, down
, etc.
Solution Attempt
I tried to solve this the usual way, viz., by exporting the state; clearing the `pending_operations`; and re-importing it. I’m not certain if I’m doing this right, as I wasn’t able to find much documentation on this, but this is how that’s happening:
# EXPORT STATE
# ############
print('Exporting deployment...')
stack_data = stack.workspace.export_stack(stack_name)
with open('stack.json', 'w+') as output:
output.write(str(stack_data))
print('Deployment exported.')
I then modify the stack.json
to remove pending_operations
, and attempt to re-import:
# IMPORT STATE
# ############
print('Importing deployment...')
with open('stack.json', 'r') as stack_data:
deployment = auto._workspace.Deployment(deployment=stack_data.read())
stack.workspace.import_stack(stack_name, deployment)
print('Deployment imported.')
Expected Behavior
I’d expect to see output analogous to that produced by the CLI in this circumstance, namely:
# From: <https://www.pulumi.com/docs/troubleshooting/>
$ pulumi stack export | pulumi stack import
warning: removing pending operation 'creating' on '...' from snapshot
Import successful.
Issue
Instead, I get the following, fairly confusing error:
File "/Users/{SCRUBBED}/env/lib/python3.10/site-packages/pulumi/automation/_cmd.py", line 78, in _run_pulumi_cmd
raise create_command_error(result)
pulumi.automation.errors.CommandError:
code: 255
stdout:
stderr: error: the stack 'dev-3' is too old to be used by this version of the Pulumi CLI
I upgraded the CLI, the pulumi
package, and attempted re-importing an unmodified state file (i.e., export and immediately import, without making changes to pending_operations
), to no avail.
I’m not sure where to look for information on the error code or where this comes from, and I found no hints after examining the source.
Any input would be much appreciated — I’d rather not tear down the stack out-of-band just to recreate it (and maybe hit the same issue anyway).
Thanks in advance!broad-fall-19241
04/08/2022, 7:24 PMup
got interrupted (can’t recall if it was a network error or if I cancelled w/ Ctrl + C
). This, of course, left some pending_operations
in the state that prevent the use of up
, down
, etc.
Solution Attempt
I tried to solve this the usual way, viz., by exporting the state; clearing the `pending_operations`; and re-importing it. I’m not certain if I’m doing this right, as I wasn’t able to find much documentation on this, but this is how that’s happening:
# EXPORT STATE
# ############
print('Exporting deployment...')
stack_data = stack.workspace.export_stack(stack_name)
with open('stack.json', 'w+') as output:
output.write(str(stack_data))
print('Deployment exported.')
I then modify the stack.json
to remove pending_operations
, and attempt to re-import:
# IMPORT STATE
# ############
print('Importing deployment...')
with open('stack.json', 'r') as stack_data:
deployment = auto._workspace.Deployment(deployment=stack_data.read())
stack.workspace.import_stack(stack_name, deployment)
print('Deployment imported.')
Expected Behavior
I’d expect to see output analogous to that produced by the CLI in this circumstance, namely:
# From: <https://www.pulumi.com/docs/troubleshooting/>
$ pulumi stack export | pulumi stack import
warning: removing pending operation 'creating' on '...' from snapshot
Import successful.
Issue
Instead, I get the following, fairly confusing error:
File "/Users/{SCRUBBED}/env/lib/python3.10/site-packages/pulumi/automation/_cmd.py", line 78, in _run_pulumi_cmd
raise create_command_error(result)
pulumi.automation.errors.CommandError:
code: 255
stdout:
stderr: error: the stack 'dev-3' is too old to be used by this version of the Pulumi CLI
I upgraded the CLI, the pulumi
package, and attempted re-importing an unmodified state file (i.e., export and immediately import, without making changes to pending_operations
), to no avail.
I’m not sure where to look for information on the error code or where this comes from, and I found no hints after examining the source.
Any input would be much appreciated — I’d rather not tear down the stack out-of-band just to recreate it (and maybe hit the same issue anyway).
Thanks in advance!great-queen-39697
04/08/2022, 8:50 PMTF_LOG=TRACE pulumi up -v=11 --logflow --logtostderr 2>&1 | tee -a pulumi_log.txt
broad-fall-19241
04/10/2022, 2:03 AMgreat-queen-39697
04/12/2022, 3:15 PM