even though I get the resource in the stack in my ...
# general
a
even though I get the resource in the stack in my pulumi console
s
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
yes, I’m using the provider opt parameter to guarantee the region
const provider = new aws.Provider(providerName, { region: 'eu-west-1' });
s
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
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
How are you then calling that function?
a
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
And you see the beanstalk apps being created in the pulumi CLI?
a
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