Commit 6dc647da authored by Rucha Deshpande's avatar Rucha Deshpande Committed by ethiraj krishnamanaidu
Browse files

Feat/aws r3 schema

parent b130bfb3
......@@ -26,6 +26,7 @@ variables:
AWS_BUILD_SUBDIR: provider/schema-aws/build-aws
AWS_TEST_SUBDIR: testing/schema-test-core
AWS_DEPLOYMENTS_SUBDIR: deployments/scripts/aws
AWS_SERVICE: schema
AWS_ENVIRONMENT: dev
AWS_MAVEN_TEST_COMMAND_OVERRIDE: verify
......@@ -65,3 +66,4 @@ include:
file: 'cloud-providers/osdu-gcp-cloudrun.yml'
- local: "/devops/azure/gitlab-bootstrap.yml"
- local: "/devops/aws/bootstrap.yaml"
# Copyright © 2020 Amazon Web Services
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os;
import boto3;
import jwt;
class AwsToken(object):
def get_aws_id_token(self):
client = boto3.client('cognito-idp', region_name=os.environ["AWS_REGION"])
userAuth = client.initiate_auth(
ClientId= os.environ['AWS_COGNITO_CLIENT_ID'],
AuthFlow= os.environ['AWS_COGNITO_AUTH_FLOW'],
AuthParameters= {
"USERNAME": os.environ['AWS_COGNITO_AUTH_PARAMS_USER'],
"PASSWORD": os.environ['AWS_COGNITO_AUTH_PARAMS_PASSWORD']
})
token = 'Bearer ' + userAuth['AuthenticationResult']['AccessToken']
print(token)
return token
if __name__ == '__main__':
AwsToken().get_aws_id_token()
\ No newline at end of file
echo $AWS_BASE_URL
export AWS_SCHEMA_SERVICE_URL=$AWS_BASE_URL/api/schema-service/v1/schema
BEARER_TOKEN=`python $AWS_DEPLOYMENTS_SUBDIR/Token.py`
echo $BEARER_TOKEN
export BEARER_TOKEN=$BEARER_TOKEN
export APP_KEY=""
export DATA_PARTITION=common
python deployments/scripts/DeploySharedSchemas.py -l load_sequence.1.0.0.json -u $AWS_SCHEMA_SERVICE_URL
\ No newline at end of file
boto3==1.14.40
botocore==1.17.54
PyJWT==1.7.1
requests
\ No newline at end of file
aws_bootstrap:
stage: bootstrap
image: python:3.8
needs: ["aws-update-ecs"]
script:
- pip install -r $AWS_DEPLOYMENTS_SUBDIR/requirements.txt
- chmod +x $AWS_DEPLOYMENTS_SUBDIR/bootstrap.sh
- $AWS_DEPLOYMENTS_SUBDIR/bootstrap.sh
only:
variables:
- $AWS == 'true'
aws-test-java:
needs: ["aws_bootstrap"]
only:
variables:
- $AWS == 'true'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment