Questions tagged with DevOps

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Getting error "Request is missing Authentication Token" on serverless deploy for af-south-1 region

We are using buildspec and serverless to deploy our lambdas to was. It was working fine till early morning India time. But in post build, started seeing the error "Request is missing Authentication Token". `` ``` version: 0.2 phases: install: commands: - npm install -g serverless@3.13.0 build: commands: - env="dev" && region="af-south-1" - echo $CODEBUILD_WEBHOOK_HEAD_REF - if [ "$CODEBUILD_WEBHOOK_HEAD_REF" = "refs/heads/main" ]; then env="prod"; elif [ "$CODEBUILD_WEBHOOK_HEAD_REF" = "refs/heads/uat" ]; then env="uat"; elif [ "$CODEBUILD_WEBHOOK_HEAD_REF" = "refs/heads/dev" ]; then env="dev"; fi - npm install - npm run build - rm -rf node_modules - npm install --production post_build: commands: - env="dev" && region="af-south-1" - echo $CODEBUILD_WEBHOOK_HEAD_REF - if [ "$CODEBUILD_WEBHOOK_HEAD_REF" = "refs/heads/main" ]; then env="prod"; elif [ "$CODEBUILD_WEBHOOK_HEAD_REF" = "refs/heads/uat" ]; then env="uat"; elif [ "$CODEBUILD_WEBHOOK_HEAD_REF" = "refs/heads/dev" ]; then env="dev"; region="af-south-1"; elif [ "$CODEBUILD_WEBHOOK_HEAD_REF" = "refs/heads/stage" ]; then env="stage"; fi - echo "deploying for env=$env region=$region" - serverless deploy --stage $env --region $region --verbose ``` Here's the error we are getting. ``` [Container] 2022/11/28 10:36:58 Running command serverless deploy --stage $env --region $region --verbose To ensure safe major version upgrades ensure "frameworkVersion" setting in service configuration (recommended setup: "frameworkVersion: ^3.13.0") Warning: Invalid configuration encountered at 'provider': unrecognized property 'package' Learn more about configuration validation here: http://slss.io/configuration-validation Deploying test-authorizer to stage dev (af-south-1) Excluding development dependencies for service package × Stack test-authorizer-dev failed to deploy (0s) ``` We tried to deploy on us-east-1, but it worked, it just stopped working for af-south-1 Checked the following already 1. Checking the deploy role for right permissions 2. Checking the STS token - it is active 3. Also tried to change the deployment environment on codebuild. It didn't work
1
answers
2
votes
53
views
HBL9
asked 9 days ago
2
answers
0
votes
25
views
asked 10 days ago

Update Existing Cognito User Pool Group via CDK

Hi, I have a Cognito User Pool with a user group. This simple configuration deploys fine the first time. Any subsequent attempts to run `cdk deploy` with or without changes errors out with `group already exists in stack` error. I'm using Java for my CDK Here's the code I'm using to create the user poll + group ``` public void generateStack() { // Create User Pool UserPool userPool = Builder.create(scope, "some-id") .accountRecovery(AccountRecovery.EMAIL_ONLY) .autoVerify(AutoVerifiedAttrs.builder() .email(true) .phone(false) .build()) .email(UserPoolEmail.withCognito(REPLY_TO_EMAIL)) .enableSmsRole(false) .mfa(Mfa.OFF) .passwordPolicy(PasswordPolicy.builder() .minLength(8) .requireDigits(true) .requireLowercase(true) .requireUppercase(true) .tempPasswordValidity(Duration.days(TEMP_PWD_VALIDITY_IN_DAYS)) .build()) .removalPolicy(RemovalPolicy.RETAIN) .selfSignUpEnabled(true) .signInAliases(SignInAliases.builder() .email(true) .phone(false) .preferredUsername(false) .username(false) .build()) .signInCaseSensitive(false) .standardAttributes(StandardAttributes.builder() .email(StandardAttribute.builder() .mutable(false) .required(true) .build()) .givenName(StandardAttribute.builder() .mutable(true) .required(true) .build()) .familyName(StandardAttribute.builder() .mutable(true) .required(true) .build()) .phoneNumber(StandardAttribute.builder() .mutable(true) .required(true) .build()) .build()) .userPoolName("some-pool-name") .build(); Role adminRole = Role.Builder.create(scope, "role-id") .roleName("admin-role") .assumedBy(new AccountRootPrincipal()) .description("This is a full access admin role for Ops Team") .maxSessionDuration(Duration.hours(12)) .managedPolicies(List.of(ManagedPolicy.fromAwsManagedPolicyName("AdministratorAccess"))) .build(); // Add admin group new CfnUserPoolGroup(scope, "admin-users", CfnUserPoolGroupProps.builder() .description("Admin group for the Ops team") .groupName("admin-ops") .precedence(0) .roleArn(adminRole.getRoleArn()) .userPoolId(userPool.getUserPoolId()) .build()); } ``` Is there a way to stop CDK from trying to create a group if it already exists in the stack? Thanks Kunal
0
answers
0
votes
14
views
asked 12 days ago

ASP.NET Core Application not Running in AWS Linux EC2 instance instead showing Apache Test Page

I have have an AWS CodePipeline process that gets the CodeCommit repository builds the application and publish the application to the Linux EC2 instances. The entire process executes successfully and I can see the final asp.net core application gets published to the /var/www/html/ folder. But when I get loads the URL of the load balancer (EC2 instances are behind a load balancer), I see the Apache test page, not the asp.net core application. The asp.net core application I created is just the default asp.net core web application that gets created by default. Below is the buildspec.yaml file. (This publishes a self-contained application) ``` version: 0.2 env: variables: DOTNET_CORE_RUNTIME: 6.0 phases: install: on-failure: ABORT runtime-versions: dotnet: ${DOTNET_CORE_RUNTIME} commands: - echo install stage - started `date` pre_build: commands: - echo pre build stage - stared `date` - echo restore dependencies started `date` - dotnet restore ./WebApplication1/WebApplication1.csproj build: commands: - echo build stage - started `date` - dotnet publish --configuration Release --runtime linux-x64 ./WebApplication1/WebApplication1.csproj --self-contained - cp ./WebApplication1/appspec.yml ./WebApplication1/bin/Release/net6.0/linux-x64/publish/ artifacts: files: - '**/*' - appspec.yml name: artifact-test-cham discard-paths: no base-directory: ./WebApplication1/bin/Release/net6.0/linux-x64/publish/ ``` And below is the appspec.yaml file that copies the content from the S3 artifact location to the /var/www/html/ folder ``` version: 0.0 os: linux files: - source: / destination: /var/www/html/ ``` Following image shows that the web application gets successfully published to the /var/www/html folder in the Linux EC2 instance with other asp.net core framework dependent files. But even though all the web application files along with other framework files are available, as I said, when I navigate through the load balancer, I can see the Apache test page only. ![Enter image description here](/media/postImages/original/IMrj2EksFtRkigsg3lcuTJBA) Below is the "Configure" method in the application. ``` // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseStatusCodePages(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); }); } ``` What am I doing wrong in here? Do I have to do something from the application side? Please let me know. UPDATE: Below is the instance UserData used to in each EC2 instance. ``` #!/bin/bash -xe sudo su sudo yum -y update yum install -y ruby yum install -y aws-cli sudo amazon-linux-extras install -y php7.2 sudo yum install httpd -y sudo systemctl start httpd sudo systemctl enable httpd sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm cd /home/ec2-user # downloading & installing CodeDeploy Agent as per https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-s3.html#S3-create-instances aws s3 cp s3://aws-codedeploy-${AWS::Region}/latest/install . --region ${AWS::Region} chmod +x ./install ./install auto ```
2
answers
0
votes
66
views
champer
asked 17 days ago