bulky-balloon-31221
01/27/2023, 11:03 AMsticky-church-6919
01/27/2023, 12:33 PMsticky-church-6919
01/27/2023, 12:33 PMnice-rain-32013
01/27/2023, 3:28 PMshow grants of role ACCOUNTADMIN;
<output redacted>
role granted_to grantee_name
------------ ---------- ---------------------
ACCOUNTADMIN USER ******
ACCOUNTADMIN ROLE PULUMI_ROLE
ACCOUNTADMIN USER *****************.com
ACCOUNTADMIN USER ***********.com
ACCOUNTADMIN USER *************.com
ACCOUNTADMIN USER ************.com
ACCOUNTADMIN USER ***************.com
when importing, I expect the following command to pull in the roles mentioned above:
pulumi import --diff snowflake:index/roleGrants:RoleGrants ACCOUNTADMIN ACCOUNTADMIN
but the result is disappointing:
accountadmin = snowflake.RoleGrants(
"ACCOUNTADMIN",
role_name="ACCOUNTADMIN",
opts=pulumi.ResourceOptions(protect=True))
No mention of grantee roles or users here, what am I missing?
thanks!big-angle-30002
01/27/2023, 5:55 PMRUN aws configure set aws_default_prodile $PULUMI_S3_AWS_DEFAULT_PROFILE
RUN aws configure set aws_access_key_id $PULUMI_S3_AWS_ACCESS_KEY_ID
RUN aws configure set aws_secret_access_key $PULUMI_S3_AWS_SECRET_ACCESS_KEY
RUN aws configure set default-region $PULUMI_S3_AWS_DEFAULT_REGION
# TODO: make pulumi login no hard code
RUN pulumi --non-interactive login '<s3://archie23>-${STAGE}-pulumi-backend?region=${PULUMI_S3_AWS_DEFAULT_REGION}&awssdk=v2&profile=${PULUMI_S3_AWS_DEFAULT_PROFILE}'
but in the step 35 crash:
Step 31/45 : RUN aws configure set aws_default_prodile $PULUMI_S3_AWS_DEFAULT_PROFILE
---> Running in 3aa5ef2e4978
Removing intermediate container 3aa5ef2e4978
---> 479c2649a3c3
Step 32/45 : RUN aws configure set aws_access_key_id $PULUMI_S3_AWS_ACCESS_KEY_ID
---> Running in 86446c0c9058
Removing intermediate container 86446c0c9058
---> f7e2e41f43f1
Step 33/45 : RUN aws configure set aws_secret_access_key $PULUMI_S3_AWS_SECRET_ACCESS_KEY
---> Running in 282e2d08e50a
Removing intermediate container 282e2d08e50a
---> a56e9d25e713
Step 34/45 : RUN aws configure set default-region $PULUMI_S3_AWS_DEFAULT_REGION
---> Running in e2f39cfad76e
Removing intermediate container e2f39cfad76e
---> 837b42c8b01e
Step 35/45 : RUN pulumi --non-interactive login '<s3://archie23>-${STAGE}-pulumi-backend?region=${PULUMI_S3_AWS_DEFAULT_REGION}&awssdk=v2&profile=${PULUMI_S3_AWS_DEFAULT_PROFILE}'
---> Running in 4fce5d9c0a7f
error: problem logging in: PULUMI_ACCESS_TOKEN must be set for login during non-interactive CLI sessions
The command '/bin/sh -c pulumi --non-interactive login '<s3://archie23>-${STAGE}-pulumi-backend?region=${PULUMI_S3_AWS_DEFAULT_REGION}&awssdk=v2&profile=${PULUMI_S3_AWS_DEFAULT_PROFILE}'' returned a non-zero code: 255
quiet-helmet-40109
01/27/2023, 7:56 PMshy-gold-87158
01/27/2023, 10:31 PMbroad-holiday-50009
01/28/2023, 12:17 AMcuddly-magician-97620
01/28/2023, 1:22 AMamazon-ecs-deploy-task-definition
GitHub action to deploy containers to the Fargate service provisioned with Pulumi. My GitHub workflow reads Pulumi stack output, and feeds the task definition to the GitHub action. The action expects containerDefinitions
in a JSON format, and nested under the task_definition
key. However, a simple output in the following form:
export const fgtest = {
task_definition: service.taskDefinition.taskDefinition,
}
results in containerDefinitions
key serialized to a string.
I have a relatively simple taskDefinitionOutput
function that deserializes that key into proper JSON, but I am unable to make it work with the new Crosswalk.
Any attempt to use the spread operator on the new Crosswalk task definition output results in this obscure error:
TypeError: prop.apply is not a function
Here is a sample code that works with the old (classic) Crosswalk:
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
const stack = pulumi.getStack();
// taskDefinitionOutput helps return a valid taskDefinition for use in CI/CD
export function taskDefinitionOutput(fargate: awsx.classic.ecs.FargateService) {
const { id, arn, urn, ...taskDefinition } =
fargate.taskDefinition.taskDefinition;
return {
...taskDefinition,
containerDefinitions: taskDefinition.containerDefinitions.apply((data) =>
JSON.parse(data)
),
};
}
const cluster = new awsx.classic.ecs.Cluster(`cluster-${stack}`, {});
const listener = new awsx.classic.lb.NetworkListener(`nginx-${stack}`, { port: 80 });
const service = new awsx.classic.ecs.FargateService(`service-${stack}`, {
cluster: cluster,
assignPublicIp: true,
desiredCount: 2,
taskDefinitionArgs: {
container: {
image: "nginx:latest",
cpu: 512,
memory: 128,
essential: true,
portMappings: [listener],
},
},
});
export const url = listener.endpoint;
export const fgtest = {
task_definition: taskDefinitionOutput(service),
}
And here is the (failing) attempt at refactoring for new Crosswalk:
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
const stack = pulumi.getStack();
// taskDefinitionOutput helps return a valid taskDefinition for use in CI/CD
export function taskDefinitionOutput(taskDefinitionOutput: any) {
return {
...taskDefinitionOutput,
containerDefinitions: taskDefinitionOutput.containerDefinitions.apply((data:any) =>
JSON.parse(data)
),
};
}
const cluster = new aws.ecs.Cluster(`cluster-${stack}`, {});
const lb = new awsx.lb.ApplicationLoadBalancer(`lb-${stack}`, {});
const service = new awsx.ecs.FargateService(`service-${stack}`, {
cluster: cluster.arn,
assignPublicIp: true,
desiredCount: 2,
taskDefinitionArgs: {
container: {
image: "nginx:latest",
cpu: 512,
memory: 128,
essential: true,
portMappings: [{
targetGroup: lb.defaultTargetGroup,
}],
},
},
});
export const url = lb.loadBalancer.dnsName;
export const fgtest = {
task_definition: taskDefinitionOutput(service.service.taskDefinition),
}
Please help.rough-analyst-22850
01/28/2023, 3:41 AMcreamy-monkey-35142
01/29/2023, 9:55 AMstack_auto = auto.select_stack(stack_name, work_dir='../stacks')
print(f"successfully select stack {stack_name}")
print("Previewing stack")
stack_auto.preview(on_output=print, target=stack_target)
print("Preview complete")
since stack_target
is an array like [‘**DOMAIN_abc’] and what I expect is pulumi will preview only on urn matched **DOMAIN_abc
but python script above running on all urn even not matched with **DOMAIN_abc
p/s: ran with pulumi preview --stack <stack_name> --target "**DOMAIN_abc"
was worked wellmost-napkin-6669
01/29/2023, 11:43 AMView Live: <https://app.pulumi.com/neurohelp/ecs-oscs/dev/updates/126>
Type Name Status
- pulumi:pulumi:Stack ecs-oscs.dev deleted
- ├─ aws:ecs:Service ecs-oscs-dev-ecs-service deleted (434s)
brave-wall-78117
01/29/2023, 12:55 PMpublic sealed class DynamoDbResource : ComponentResource
{
public DynamoDbResource(string name)
: base("account-transactions-dynamodb", name)
{
var stack = Deployment.Instance.StackName;
var userTradesTable = new Table("user-trades-table", new()
{
Attributes = new[]
{
new TableAttributeArgs
{
Name = "Date",
Type = "S",
},
new TableAttributeArgs
{
Name = "TradeSourceId",
Type = "S",
}
},
Name = $"user-trades-{stack}",
BillingMode = "PAY_PER_REQUEST",
HashKey = "Date",
RangeKey = "TradeSourceId"
});
var userTransfersTable = new Table("user-transfers-table", new()
{
Attributes = new[]
{
new TableAttributeArgs
{
Name = "Date",
Type = "S",
},
new TableAttributeArgs
{
Name = "TransferSourceId",
Type = "S",
}
},
Name = $"user-transfers-{stack}",
BillingMode = "PAY_PER_REQUEST",
HashKey = "Date",
RangeKey = "TransferSourceId"
});
var role = CreateIamRoleAndAllowActionsForTables(userTradesTable.Arn, userTransfersTable.Arn);
UserTradesTableArn = userTradesTable.Arn;
UserTransfersTableArn = userTransfersTable.Arn;
RoleArn = role.Arn;
}
[Output("userTradesTable")]
public Output<string> UserTradesTableArn { get; set; }
[Output("userTransfersTable")]
public Output<string> UserTransfersTableArn { get; set; }
[Output("role")]
public Output<string> RoleArn { get; set; }
private Role CreateIamRoleAndAllowActionsForTables(params Output<string>[] tables)
{
var projectName = Deployment.Instance.ProjectName;
var role = new Role($"{projectName}-role", new RoleArgs
{
AssumeRolePolicy = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Version"] = "2012-10-17",
["Statement"] = new[]
{
new Dictionary<string, object?>
{
["Action"] = "sts:AssumeRole",
["Effect"] = "Allow",
["Sid"] = "",
["Principal"] = new Dictionary<string, object?>
{
["AWS"] = "arn:aws:iam::545464702807:root"
}
}
}
}),
InlinePolicies =
{
new RoleInlinePolicyArgs
{
Name = "dynamodb",
Policy = Output.All(tables).Apply(args =>
{
return JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Version"] = "2012-10-17",
["Statement"] = new[]
{
new Dictionary<string, object?>
{
["Action"] = new[]
{
"dynamodb:BatchWriteItem",
"dynamodb:PutItem",
"dynamodb:DeleteItem",
"dynamodb:UpdateItem",
"dynamodb:DescribeTable",
"dynamodb:Query"
},
["Effect"] = "Allow",
["Resource"] = new[] { args[0] }
},
new Dictionary<string, object?>
{
["Action"] = "dynamodb:ListTables",
["Effect"] = "Allow",
["Resource"] = "*"
}
}
});
})
}
}
});
return role;
}
}
Guys, I'm trying to figure out what is best practices for the allocated services. Should I put all of services in ComponentResource
? E.g. SQS, SNS, DynamoDB, S3, Secrets Managerbulky-balloon-31221
01/30/2023, 6:34 AMcolossal-vr-62639
01/30/2023, 7:57 AMDiagnostics:
github:index:RepositoryEnvironment (preproduction):
error: PUT <https://api.github.com/repos//pulumi-sample/environments/preproduction>: 404 Not Found []
github:index:RepositoryEnvironment (sandbox):
error: PUT <https://api.github.com/repos//pulumi-sample/environments/sandbox>: 404 Not Found []
The value for the GitHub owner should be where the double //
are after repos
cool-vr-43155
01/30/2023, 8:59 AMpulumi config set aws:assumeRole
configuration doesn't work.
related issue - https://github.com/pulumi/pulumi/issues/10316 (closed due to no response)stocky-father-68249
01/30/2023, 10:21 AMcreamy-monkey-35142
01/30/2023, 11:35 AMpulumi/action@v4
and getting error, base in code it’s refer to
def get_config_env() -> Dict[str, Any]:
"""
Returns the environment map that will be used for config checking when variables aren't set.
"""
if "PULUMI_CONFIG" in os.environ:
env_config = os.environ["PULUMI_CONFIG"]
return json.loads(env_config)
return {}
but from https://www.pulumi.com/docs/reference/cli/environment-variables/ say PULUMI_CONFIG
> This environment variable is ignored during normal Pulumi operations -- e.g., up
, preview
, etc.
github action yaml file is
- uses: pulumi/actions@v4
with:
command: preview
stack-name: ${{ matrix.stack }}
comment-on-pr: false
github-token: ${{ secrets.GITHUB_TOKEN }}
cloud-url: "<s3://system-pulumi/batdongsan?endpoint=s3.bds.lc&s3ForcePathStyle=true>"
work-dir: stacks
target: ${{ matrix.target }}
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_REGION: ${{secrets.AWS_REGION}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
CLOUDFLARE_API_KEY: ${{secrets.CLOUDFLARE_API_KEY}}
CLOUDFLARE_EMAIL: ${{secrets.CLOUDFLARE_EMAIL}}
PULUMI_CONFIG_PASSPHRASE: ${{secrets.PULUMI_CONFIG_PASSPHRASE}}
So I’m thinking there is have a misconfigured, can you help me take a look?fresh-scientist-11672
01/30/2023, 1:03 PMpulumi refresh
that is stucking on a Gitlab CI... I am not sure what is the root cause, networking issues, etc.... have anyone went through something similar or have any ideas on how to debug it? my cloud provider is gcp btw...gorgeous-printer-90037
01/30/2023, 3:42 PMcreamy-monkey-35142
01/30/2023, 3:52 PMpulumi/action
on Github action?elegant-stone-39023
01/30/2023, 4:16 PMquick-airport-30353
01/30/2023, 10:20 PMechoing-oil-42947
01/31/2023, 12:06 AMhttps://share.asdn.dev/r/0joAmR.png▾
echoing-oil-42947
01/31/2023, 12:08 AMhttps://share.asdn.dev/r/pzQQal.png▾
dependsOn
resource 3 explicitly? Or because 3 is a child of 2, will 1 wait until 3 is provisioned if only given a dependency on 2 manuallybrash-beard-75235
01/31/2023, 3:57 AMcuddly-computer-18851
01/31/2023, 5:19 AMpulumi import ...
shows
logPublishingOptions : [
[0]: {
enabled : false
logType : "ES_APPLICATION_LOGS"
}
]
however this resource is impossible to recreate exactly on the Typescript side, because cloudwatchLogGroupArn
is a required property.
https://www.pulumi.com/registry/packages/aws/api-docs/opensearch/domain/#domainlogpublishingoption
What do I do? Thanks for any advice 😃stocky-sundown-45608
01/31/2023, 8:04 AMdry-keyboard-94795
01/31/2023, 8:59 AMcreamy-monkey-35142
01/31/2023, 9:29 AM