https://pulumi.com logo
#getting-started
Title
# getting-started
s

salmon-sandwich-15994

08/21/2022, 12:31 AM
I always get this message when using a template with pulumi up. "error: azure-nativeresourcesResourceGroup resource 'resourceGroup' has a problem: missing required property 'location'. Either set it explicitly or configure it with 'pulumi config set azure-native:location <value>'." Steps to reproduce this error: pulumi config set azure-native:location westus2 pulumi up https://github.com/pulumi/examples/tree/master/azure-py-aci What I have tried: I have deleted all of my stacks to start fresh, but it still gives the same error. I have looked at the documentation to make sure I am not missing some key syntax, but everything looks correct. Here is what my command line looks like:
Copy code
gitpod /workspace/pulumi/p $ pulumi config set azure-native:location westus2
Please choose a stack, or create a new one: <create a new stack>
Please enter your desired stack name.
To create a stack in an organization, use the format <org-name>/<stack-name> (e.g. `acmecorp/dev`): dev
Created stack 'dev'
gitpod /workspace/pulumi/p $ pulumi config set azure-native:location westus2
gitpod /workspace/pulumi/p $ pulumi up <https://github.com/pulumi/examples/tree/master/azure-py-aci>
project name: (azure-py-aci) 
project description: (Creates Azure Container Instance with a public IP) 
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) 
Created stack 'dev'
Failed to resolve python version command: fork/exec /tmp/pulumi-up-1211997133/venv/bin/python: no such file or directory

Installing dependencies...

Creating virtual environment...
Finished creating virtual environment
Updating pip, setuptools, and wheel in virtual environment...
Requirement already satisfied: pip in ./venv/lib/python3.8/site-packages (21.1.1)
Collecting pip
  Using cached pip-22.2.2-py3-none-any.whl (2.0 MB)
Requirement already satisfied: setuptools in ./venv/lib/python3.8/site-packages (56.0.0)
Collecting setuptools
  Using cached setuptools-65.1.0-py3-none-any.whl (1.2 MB)
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 56.0.0
    Uninstalling setuptools-56.0.0:
      Successfully uninstalled setuptools-56.0.0
  Attempting uninstall: pip
    Found existing installation: pip 21.1.1
    Uninstalling pip-21.1.1:
      Successfully uninstalled pip-21.1.1
Successfully installed pip-22.2.2 setuptools-65.1.0 wheel-0.37.1
Finished updating
Installing dependencies in virtual environment...
Collecting pulumi<4.0.0,>=3.5.1
  Using cached pulumi-3.38.0-py2.py3-none-any.whl (166 kB)
Collecting pulumi-azure-native<2.0.0,>=1.14.0
  Using cached pulumi_azure_native-1.68.2-py3-none-any.whl
Collecting six~=1.12
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pyyaml~=5.3
  Using cached PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl (662 kB)
Collecting grpcio==1.47
  Using cached grpcio-1.47.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB)
Collecting dill~=0.3
  Using cached dill-0.3.5.1-py2.py3-none-any.whl (95 kB)
Collecting semver~=2.8
  Using cached semver-2.13.0-py2.py3-none-any.whl (12 kB)
Collecting protobuf~=4.21
  Using cached protobuf-4.21.5-cp37-abi3-manylinux2014_x86_64.whl (408 kB)
Collecting parver>=0.2.1
  Using cached parver-0.3.1-py2.py3-none-any.whl (14 kB)
Collecting attrs>=19.2
  Using cached attrs-22.1.0-py2.py3-none-any.whl (58 kB)
Collecting arpeggio~=1.7
  Using cached Arpeggio-1.10.2-py2.py3-none-any.whl (54 kB)
Installing collected packages: arpeggio, six, semver, pyyaml, protobuf, dill, attrs, parver, grpcio, pulumi, pulumi-azure-native
Successfully installed arpeggio-1.10.2 attrs-22.1.0 dill-0.3.5.1 grpcio-1.47.0 parver-0.3.1 protobuf-4.21.5 pulumi-3.38.0 pulumi-azure-native-1.68.2 pyyaml-5.4.1 semver-2.13.0 six-1.16.0
Finished installing dependencies
Finished installing dependencies

Previewing update (dev)

View Live: <https://app.pulumi.com/aselunar/azure-py-aci/dev/previews/05e20ed7-f05a-4ec2-a0c4-5f5336cf5ce2>

     Type                                     Name              Plan       Info
 +   pulumi:pulumi:Stack                      azure-py-aci-dev  create     
     └─ azure-native:resources:ResourceGroup  resourceGroup                1 error
 
Diagnostics:
  azure-native:resources:ResourceGroup (resourceGroup):
    error: azure-native:resources:ResourceGroup resource 'resourceGroup' has a problem: missing required property 'location'. Either set it explicitly or configure it with 'pulumi config set azure-native:location <value>'.
👍 1
b

billowy-army-68599

08/22/2022, 12:03 AM
Hi @salmon-sandwich-15994 - why are you running:
Copy code
pulumi up <https://github.com/pulumi/examples/tree/master/azure-py-aci>
?
The order you’re running commands in isn’t best practice.
Copy code
pulumi new python-azure
pulumi config set azure-native:location westus2
pulumi up
s

salmon-sandwich-15994

08/22/2022, 12:05 AM
When using a template, what pulumi command should I use? I thought I was supposed to use pulumi up passing in the template as an argument. What should I do instead? What is the correct syntax?
b

billowy-army-68599

08/22/2022, 12:08 AM
pulumi up
executes your pulumi code that you’ve written
pulumi new
is the command you want to use to specify a template
what you’re passing isn’t a template url though, it’s an example
s

salmon-sandwich-15994

08/22/2022, 12:10 AM
Like this?
Copy code
pulumi new python-azure
pulumi config set azure-native:location westus2
pulumi new <https://github.com/pulumi/examples/blob/master/azure-py-aci/__main__.py>
pulumi up
b

billowy-army-68599

08/22/2022, 12:37 AM
no, you cannot pass the url you’re passing
that url isn’t a template, you’ll have to copy and paste the code you want into your program
5 Views