https://pulumi.com logo
a

acceptable-air-67821

01/18/2019, 7:16 PM
even though I get the resource in the stack in my pulumi console
s

stocky-spoon-28903

01/18/2019, 7:19 PM
Hi @acceptable-air-67821! That’s not particularly good! First things first, are you certain you’re comparing the correct region in the console vs the stack?
a

acceptable-air-67821

01/18/2019, 7:20 PM
yes, I’m using the provider opt parameter to guarantee the region
const provider = new aws.Provider(providerName, { region: 'eu-west-1' });
s

stocky-spoon-28903

01/18/2019, 7:21 PM
OK great, that’s the easy thing out the way
What does your program look like?
(Feel free to private gist and DM if you’d like, and ensure anything sensitive is removed, obviously!)
a

acceptable-air-67821

01/18/2019, 7:21 PM
Copy code
export default (provider: aws.Provider) => {
  const applicationNames = [
    createRegionalResourceName('backend', 'beanstalk-app', '-dino'),
    createRegionalResourceName('frontend', 'beanstalk-app', '-barney'),
  ];

  return applicationNames.map(an => new aws.elasticbeanstalk.Application(
    an,
    {
      name: an,
    },
    { provider },
  ));
};
s

stocky-spoon-28903

01/18/2019, 7:22 PM
How are you then calling that function?
a

acceptable-air-67821

01/18/2019, 7:22 PM
createRegionalResourceName
is a function that returns a string.
so don’t mind, it’s cleaner concatenation.
in my
index.ts
the function is called like this.
Copy code
import * as aws from '@pulumi/aws';

import { createManualNetwork, createBeanstalkApps } from './src/resources';

const providerName = 'eu-west-1-provider';
const provider = new aws.Provider(providerName, { region: 'eu-west-1' });

async function main() {
  const manualNetwork = await createManualNetwork(provider, 'manual-uat');
  const beanstalkApps = await createBeanstalkApps(provider);
}

main();
s

stocky-spoon-28903

01/18/2019, 7:24 PM
And you see the beanstalk apps being created in the pulumi CLI?
a

acceptable-air-67821

01/18/2019, 9:09 PM
sorry, i had to move from my desk.
Yes, the apps, show up in the CLI.
Copy code
Changes:
 
    Type                             Name                          Operation
+   aws:elasticbeanstalk:Application backend-beanstalk-app-dino    created
+   aws:elasticbeanstalk:Application frontend-beanstalk-app-barney created
-   aws:elasticbeanstalk:Application frontend-beanstalk-appbarney  deleted
-   aws:elasticbeanstalk:Application backend-beanstalk-appdino     deleted
 
Resources:
    + created 2
    - deleted 2
    44 unchanged
 
Duration: 12s