投稿時間:2023-01-10 03:22:17 RSSフィード2023-01-10 03:00 分まとめ(31件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT InfoQ 6 Essential Tracks at QCon London, March 27-29, 2023: Architecture, FinTech, ML, and More! https://www.infoq.com/news/2023/01/qcon-london-tracks/?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global Essential Tracks at QCon London March Architecture FinTech ML and More QCon London international software conference returns this March with its th edition Technical leaders that are driving innovation and change in software will share the latest trends and techniques from their real world projects to help you solve common challenges Learn what are the emerging trends in how to adopt them how to avoid pitfalls and how to embrace the best practices By Artenisa Chatziou 2023-01-09 17:30:00
AWS AWS News Blog Happy New Year! AWS Week in Review – January 9, 2023 https://aws.amazon.com/blogs/aws/happy-new-year-aws-week-in-review-january-9-2023/ Happy New Year AWS Week in Review January Happy New Year As we kick off I wanted to take a moment to remind you of some predictions by AWS leaders for you to help prepare for the new year Five Tech Predictions for and Beyond by Dr Wener Vogels CTO of Amazon com Read how these technologies and trends will … 2023-01-09 17:00:19
AWS AWS Machine Learning Blog Model hosting patterns in Amazon SageMaker, Part 1: Common design patterns for building ML applications on Amazon SageMaker https://aws.amazon.com/blogs/machine-learning/model-hosting-patterns-in-amazon-sagemaker-part-1-common-design-patterns-for-building-ml-applications-on-amazon-sagemaker/ Model hosting patterns in Amazon SageMaker Part Common design patterns for building ML applications on Amazon SageMakerMachine learning ML applications are complex to deploy and often require the ability to hyper scale and have ultra low latency requirements and stringent cost budgets Use cases such as fraud detection product recommendations and traffic prediction are examples where milliseconds matter and are critical for business success Strict service level agreements SLAs need to be met … 2023-01-09 17:08:11
AWS AWS How can I activate and deactivate SQL Server Service Broker for Amazon RDS for SQL Server? https://www.youtube.com/watch?v=IpgDFIC0J34 How can I activate and deactivate SQL Server Service Broker for Amazon RDS for SQL Server For more details see the Knowledge Center article with this video Henrique shows you how to activate and deactivate SQL Server Service Broker for Amazon RDS for SQL Server Introduction Chapter Chapter ClosingSubscribe More AWS videos More AWS events videos ABOUT AWSAmazon Web Services AWS is the world s most comprehensive and broadly adopted cloud platform offering over fully featured services from data centers globally Millions of customers ーincluding the fastest growing startups largest enterprises and leading government agencies ーare using AWS to lower costs become more agile and innovate faster AWS AmazonWebServices CloudComputing 2023-01-09 17:19:28
AWS AWS Why can't my EC2 instance connect to the internet when using an internet gateway? https://www.youtube.com/watch?v=RVLD0SHtwIc Why can x t my EC instance connect to the internet when using an internet gateway Skip directly to the demo For more details see the Knowledge Center article with this video Dalier shows you why your EC instance can t connect to the internet when using an internet gateway Introduction Chapter Chapter ClosingSubscribe More AWS videos More AWS events videos ABOUT AWSAmazon Web Services AWS is the world s most comprehensive and broadly adopted cloud platform offering over fully featured services from data centers globally Millions of customers ーincluding the fastest growing startups largest enterprises and leading government agencies ーare using AWS to lower costs become more agile and innovate faster AWS AmazonWebServices CloudComputing 2023-01-09 17:18:21
Ruby Rubyタグが付けられた新着投稿 - Qiita (備忘録)Java概要 https://qiita.com/hellotechcamp/items/ef3c972a5cd6db052536 javascript 2023-01-10 02:07:14
Ruby Railsタグが付けられた新着投稿 - Qiita (備忘録)Java概要 https://qiita.com/hellotechcamp/items/ef3c972a5cd6db052536 javascript 2023-01-10 02:07:14
海外TECH Ars Technica The US needs 8x more EV chargers by 2030, according to new report https://arstechnica.com/?p=1908613 chargers 2023-01-09 17:40:00
海外TECH MakeUseOf Is the Enhancement Tab Missing in Windows 11? Try These 5 Fixes https://www.makeuseof.com/enhancement-tab-missing-windows-11/ windows 2023-01-09 17:16:14
海外TECH DEV Community Running the KubernetesPodOperator in different AWS accounts when using Amazon Managed Workflows for Apache Airflow v2.x https://dev.to/aws/running-the-kubernetespodoperator-in-different-aws-accounts-when-using-amazon-managed-workflows-for-apache-airflow-v2x-51l7 Running the KubernetesPodOperator in different AWS accounts when using Amazon Managed Workflows for Apache Airflow v x Running KubernetesPodOperator in different AWS accountsI got a mail from Apurav Sharma who was looking to find out about how MWAA supported using the KubernetesPodOperator to kick off tasks in Amazon EKS Containers in any AWS account This post reveals how you can do that using a very simple task that displays the AWS account number Pre requisitesYou will need admin access to two AWS Accounts with local AWS Cli tools setup and eksctl version kubectl version at least v A MWAA environment up and running I am using MWAA with Apache Airflow As I have two different AWS accounts I am using profiles in my local aws credentials file to enable me to ensure I access the specific AWS account Any references to profile personal is referring to the second AWS account and where it is omitted the first AWS account Creating a new Amazon EKS clusterI used the same steps that were in my original blog post Working with Amazon EKS and Amazon Managed Workflows for Apache Airflow v x I will repeat those steps here to make it easier to follow along I have used the latest version of Kubernetes in this post that Amazon EKS supports To create the Amazon EKS Cluster on the first AWS account I run the following commandeksctl create cluster name mwaa eks region eu central version nodegroup name linux nodes nodes nodes min nodes max with oidc ssh access ssh public key frank open distro managed vpc public subnets subnet addc subnet bbbe vpc private subnets subnet bedfd subnet fdccabe output similar to eksctl version dev aceb T Z using region eu central using existing VPC vpc dfa and subnets private map eu central a subnet fdccabe eu central a eu central b subnet bedfd eu central b public map eu central a subnet addc eu central a eu central b subnet bbbe eu central b custom VPC subnets will be used if resulting cluster doesn t function as expected make sure to review the configuration of VPC subnets nodegroup linux nodes will use AmazonLinux using EC key pair q string lt nil gt using Kubernetes version creating EKS cluster mwaa eks in eu central region with managed nodes will create separate CloudFormation stacks for cluster itself and the initial managed nodegroup if you encounter any issues check CloudFormation console or try eksctl utils describe stacks region eu central cluster mwaa eks Kubernetes API endpoint access will use default of publicAccess true privateAccess false for cluster mwaa eks in eu central CloudWatch logging will not be enabled for cluster mwaa eks in eu central you can enable it with eksctl utils update cluster logging enable types SPECIFY YOUR LOG TYPES HERE e g all region eu central cluster mwaa eks sequential tasks create cluster control plane mwaa eks sequential sub tasks sequential sub tasks wait for control plane to become ready associate IAM OIDC provider sequential sub tasks create IAM role for serviceaccount kube system aws node create serviceaccount kube system aws node restart daemonset kube system aws node create managed nodegroup linux nodes building cluster stack eksctl mwaa eks cluster deploying stack eksctl mwaa eks cluster check cloudformation and come back in mins waiting for CloudFormation stack eksctl mwaa eks cluster waiting for CloudFormation stack eksctl mwaa eks cluster when it finishes you should see something similar to waiting for the control plane to become ready saved kubeconfig as Users ricsue kube config no tasks all EKS cluster resources for mwaa eks have been created nodegroup linux nodes has node s node ip eu central compute internal is ready node ip eu central compute internal is ready node ip eu central compute internal is ready waiting for at least node s to become ready in linux nodes nodegroup linux nodes has node s node ip eu central compute internal is ready node ip eu central compute internal is ready node ip eu central compute internal is ready kubectl command should work with Users ricsue kube config try kubectl get nodes EKS cluster mwaa eks in eu central region is readyCheck its configured correctlyeksctl utils associate iam oidc provider region eu central cluster mwaa eks approvewhich will output IAM Open ID Connect provider is already associated with cluster mwaa eks in eu central Creating a new Kubernetes namespaceCreate a new Kubernetes namespace where we will run our DAGkubectl create namespace mwaawhich will outputnamespace mwaa createdand we can check by runningkubectl get nswhich should list our new namespaceNAME STATUS AGEdefault Active mkube node lease Active mkube public Active mkube system Active mmwaa Active sCreate a role for the mwaa namespaceNow you need to create a new Kubernetes manifest file that will create a role for the MWAA namespace If you run the following command kubectl get pods n mwaa as mwaa serviceYou will probably get the following error message Error from server Forbidden pods is forbidden User mwaa service cannot list resource pods in API group in the namespace mwaa So lets fix that First we are going to create and apply a new role for the MWAA namespace cat lt lt EOF kubectl apply f n mwaakind RoleapiVersion rbac authorization ks io vmetadata name mwaa rolerules apiGroups apps batch extensions resources jobs pods pods attach pods exec pods log pods portforward secrets services verbs create delete describe get list patch update kind RoleBindingapiVersion rbac authorization ks io vmetadata name mwaa role bindingsubjects kind User name mwaa serviceroleRef kind Role name mwaa role apiGroup rbac authorization ks ioEOFWhen you run this you should get the followingrole rbac authorization ks io mwaa role createdrolebinding rbac authorization ks io mwaa role binding createdNow if we try again the command kubectl get pods n mwaa as mwaa service that generated the error above we should get a new outputNo resources found in mwaa namespace Modifying the MWAA Worker Execution policyYou now need to create a new MWAA Worker Execution role with an updated policy The steps are Create a new IAM policy Create a new IAM Role and attach the policy you created in Step and Reconfigure your MWAA environment to use this new IAM Role When creating a new IAM policy copy the existing policy statements you have in your MWAA Execution policy but add the following replacing AWS ACCOUNT NUMBER with your AWS account Effect Allow Action eks DescribeCluster Resource arn aws eks eu central AWS ACCOUNT NUMBER cluster mwaa eks This is the complete new role that I created Version Statement Effect Allow Action airflow PublishMetrics Resource arn aws airflow eu central AWS ACCOUNT NUMBER environment EKSMultiAccount Effect Deny Action s ListAllMyBuckets Resource arn aws s airflow eks multi account arn aws s airflow eks multi account Effect Allow Action s GetObject s GetBucket s List Resource arn aws s airflow eks multi account arn aws s airflow eks multi account Effect Allow Action logs CreateLogStream logs CreateLogGroup logs PutLogEvents logs GetLogEvents logs GetLogRecord logs GetLogGroupFields logs GetQueryResults Resource arn aws logs eu central AWS ACCOUNT NUMBER log group airflow EKSMultiAccount Effect Allow Action logs DescribeLogGroups Resource Effect Allow Action cloudwatch PutMetricData Resource Effect Allow Action sqs ChangeMessageVisibility sqs DeleteMessage sqs GetQueueAttributes sqs GetQueueUrl sqs ReceiveMessage sqs SendMessage Resource arn aws sqs eu central airflow celery Effect Allow Action kms Decrypt kms DescribeKey kms GenerateDataKey kms Encrypt NotResource arn aws kms AWS ACCOUNT NUMBER key Condition StringLike kms ViaService sqs eu central amazonaws com Effect Allow Action eks DescribeCluster Resource arn aws eks eu central AWS ACCOUNT NUMBER cluster mwaa eks Once you have updated your MWAA Worker Execution role with this new role the MWAA environment will take minutes to update However we need to make one more change that will also require a restart so complete the next step so we only have to do this once Deploying the Kubernetes operators into Apache AirflowCreate a new requirements txt file with the following kubernetes apache airflow cncf kubernetes And then in the S bucket that you are using for your MWAA environment create a folder and upload this file You will then need to edit your environment to point to this requirements txt file Once updated the MWAA environment will need to update which may take minutes to complete Tip You can track and debug Python library loading and import issues by reviewing the CloudWatch logs for the MWAA Worker nodes There will be a requirements install log file which you can view and this will help you troubleshoot issues Creating a new identity mappingUse the following command to create a new identity mapping for Amazon EKS replacing AWS ACCOUNT NUMBER with your AWS account number eksctl create iamidentitymapping region eu central cluster mwaa eks arn arn aws iam AWS ACCOUNT NUMBER role mwaa eks multi account role username mwaa servicewhich should output something like checking arn arn aws iam AWS ACCOUNT NUMBER role mwaa eks multi account role against entries in the auth ConfigMap adding identity arn aws iam AWS ACCOUNT NUMBER role mwaa eks multi account role to auth ConfigMapCreating your kubeconfig fileWhen we use the KubernetesPodOperator we need to provide a kube config yaml file which we will upload into the same folder as our DAG To create this we use the following command aws eks update kubeconfig region eu central kubeconfig kube config yaml name mwaa eks alias awsWhich will display the following outputAdded new context aws to Users ricsue Projects keys ssh keygen keys kube config yamlYou should now have your kube config yaml file in the same folder where AWS ACCOUNT NUMBER is your AWS Account number apiVersion vclusters cluster certificate authority data REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED REDACTED server name arn aws eks eu central AWS ACCOUNT NUMBER cluster mwaa ekscontexts context cluster arn aws eks eu central AWS ACCOUNT NUMBER cluster mwaa eks user arn aws eks eu central AWS ACCOUNT NUMBER cluster mwaa eks name awscurrent context awskind Configpreferences users name arn aws eks eu central AWS ACCOUNT NUMBER cluster mwaa eks user exec apiVersion client authentication ks io vbeta args region eu central eks get token cluster name mwaa eks command awsCreating your Apache Airflow DAGCreate your DAG using the following sample code This DAG uses the aws cli public container and runs a simple aws cli command to output the AWS account number Note You will notice the path to the kube config yaml file is usr local airflow dags kube config yaml you do not need to edit change this as long as your config file was not renamed from kube config yaml from airflow import DAGfrom datetime import datetimefrom airflow providers cncf kubernetes operators kubernetes pod import KubernetesPodOperatordefault args owner aws depends on past False start date datetime provide context True dag DAG kubernetes pod example default args default args schedule interval None kube config path usr local airflow dags kube config yaml podRun KubernetesPodOperator namespace mwaa image ubuntu image public ecr aws aws cli aws cli cmds bash arguments c aws sts get caller identity query Account output text labels foo bar name mwaa pod test task id pod task get logs True dag dag is delete operator pod False config file kube config path in cluster False cluster context aws Error and DebuggingWhen I initially ran this I got the following errorkubernetes client rest ApiException Reason UnauthorizedHTTP response headers HTTPHeaderDict Audit Id cf ec a ceee Cache Control no cache private Content Type application json Date Fri Jan GMT Content Length HTTP response body kind Status apiVersion v metadata status Failure message Unauthorized reason Unauthorized code If you get this then I suggest waiting a few moments When I initially triggered the DAG I got this error When I then went for a short lunch break and tried again it worked When you trigger this it should output the AWS account number where the Kubernetes Pod is running This is what I get when I run this UTC logging mixin py INFO Running lt TaskInstance kubernetes pod example pod task manual T running gt on host ip eu central compute internal UTC taskinstance py INFO Exporting the following env vars AIRFLOW CTX DAG OWNER awsAIRFLOW CTX DAG ID kubernetes pod exampleAIRFLOW CTX TASK ID pod taskAIRFLOW CTX EXECUTION DATE T AIRFLOW CTX DAG RUN ID manual T UTC kubernetes pod py INFO Creating pod mwaa pod test defeffaccdadce with labels dag id kubernetes pod example task id pod task execution date T bda try number UTC pod manager py WARNING Pod not yet started mwaa pod test defeffaccdadce UTC pod manager py WARNING Pod not yet started mwaa pod test defeffaccdadce UTC pod manager py INFO AWS ACCOUNT NUMBER UTC pod manager py WARNING Pod mwaa pod test defeffaccdadce log read interrupted but container base still running UTC pod manager py INFO AWS ACCOUNT NUMBER UTC pod manager py INFO Pod mwaa pod test defeffaccdadce has phase Running UTC kubernetes pod py INFO skipping deleting pod mwaa pod test defeffaccdadce UTC taskinstance py INFO Marking task as SUCCESS dag id kubernetes pod example task id pod task execution date T start date T end date T UTC local task job py INFO Task exited with return code UTC local task job py INFO downstream tasks scheduled from follow on schedule checkYou should be able to see your account number where I have shown AWS ACCOUNT NUMBER above We have now completed the first step which is configuring MWAA to execute within an Amazon EKS cluster in the SAME account as MWAA is running The next step is to get MWAA to execute a task on an Amazon EKS cluster in a different AWS account Note whilst I will be using a different AWS account I will stick within the same AWS RegionSetting up my EKS Cluster in a new AccountAs I am not going to have a MWAA environment in this new AWS Account I need to setup the Amazon EKS environment a little differently In my second AWS account I have set up a new VPC with public private subnets in the same AWS Region and I have also created a new keypair which is used when we create the new EKS Cluster You will notice here that I am using the profile personal which I have configured in my local aws credentials to point to an IAM user in the new account I create my new EKS Cluster called mwaa eks using this command eksctl create cluster name mwaa eks region eu central version nodegroup name linux nodes nodes nodes min nodes max with oidc ssh access ssh public key mwaa eks managed vpc public subnets subnet dfecebae subnet bbacfdb vpc private subnets subnet acedbbbd subnet ddcfdb profile personalConfigure IAMeksctl utils associate iam oidc provider region eu central cluster mwaa eks approve profile personalCreate a Kubernetes namespace called mwaakubectl create namespace mwaaCreate the mwaa role and service mappingcat lt lt EOF kubectl apply f n mwaakind RoleapiVersion rbac authorization ks io vmetadata name mwaa rolerules apiGroups apps batch extensions resources jobs pods pods attach pods exec pods log pods portforward secrets services verbs create delete describe get list patch update kind RoleBindingapiVersion rbac authorization ks io vmetadata name mwaa role bindingsubjects kind User name mwaa serviceroleRef kind Role name mwaa role apiGroup rbac authorization ks ioEOFWe can make sure this all looks good by typing this command and we should get the same output as we did when we ran it above kubectl get pods n mwaa as mwaa serviceEKS Role and PermissionsWe now need to create and attach an IAM role that will allow the MWAA execution workers to access this new EKS Cluster We are going to keep this policy simple but you should scope down the IAM Actions if you are doing this in production Create a new IAM Policy and Role Create the policy first as follows Version Statement Effect Allow Action eks Resource arn aws eks eu central ND AWS ACCOUNT NUMBER cluster mwaa eks Now create a new role and then attach this to the Role you create You will need to change the TRUST ASSOCIATION of the Role so that the MWAA execution worker can assume this role Version Statement Effect Allow Principal AWS arn aws iam AWS ACCOUNT NUMBER role mwaa eks multi account role Action sts AssumeRole Condition The final step is to attach this to the new EKS Cluster we have running in the second account eksctl create iamidentitymapping region eu central cluster mwaa eks arn arn aws iam ND AWS ACCOUNT NUMBER role mwaa eks access username mwaa service profile personalwhich should generate the following checking arn arn aws iam ND AWS ACCOUNT NUMBER role mwaa eks access against entries in the auth ConfigMap adding identity arn aws iam ND AWS ACCOUNT NUMBER role mwaa eks access to auth ConfigMapUpdating the MWAA Execution permissionsNow we add the following to the MWAA Execution policy of the first AWS Account where we have MWAA running All we need to do is append this to the permissions Effect Allow Action sts AssumeRole Resource arn aws iam ND AWS ACCOUNT NUMBER role mwaa eks access the complete policy now looks like this Version Statement Effect Allow Action airflow PublishMetrics Resource arn aws airflow eu central AWS ACCOUNT NUMBER environment EKSMultiAccount Effect Deny Action s ListAllMyBuckets Resource arn aws s airflow eks multi account arn aws s airflow eks multi account Effect Allow Action s GetObject s GetBucket s List Resource arn aws s airflow eks multi account arn aws s airflow eks multi account Effect Allow Action logs CreateLogStream logs CreateLogGroup logs PutLogEvents logs GetLogEvents logs GetLogRecord logs GetLogGroupFields logs GetQueryResults Resource arn aws logs eu central AWS ACCOUNT NUMBER log group airflow EKSMultiAccount Effect Allow Action logs DescribeLogGroups Resource Effect Allow Action cloudwatch PutMetricData Resource Effect Allow Action sqs ChangeMessageVisibility sqs DeleteMessage sqs GetQueueAttributes sqs GetQueueUrl sqs ReceiveMessage sqs SendMessage Resource arn aws sqs eu central airflow celery Effect Allow Action kms Decrypt kms DescribeKey kms GenerateDataKey kms Encrypt NotResource arn aws kms AWS ACCOUNT NUMBER key Condition StringLike kms ViaService sqs eu central amazonaws com Effect Allow Action eks DescribeCluster Resource arn aws eks eu central AWS ACCOUNT NUMBER cluster mwaa eks Effect Allow Action sts AssumeRole Resource arn aws iam ND AWS ACCOUNT NUMBER role mwaa eks access Creating a new kube config yamlOnce we have done this we can create a new kube config yaml file to include details of the new EKS Cluster in the second AWS account aws eks update kubeconfig region eu central kubeconfig kube config yaml name mwaa eks alias aws profile personalWe need to modify to add this to add the IAM Role details to the user section role arn aws iam ND AWS ACCOUNT NUMBER role mwaa eks accessso the full config file now looks likeapiVersion vclusters cluster certificate authority data REDACTED REDACTED server name arn aws eks eu central nd AWS ACCOUNT cluster mwaa ekscontexts context cluster arn aws eks eu central nd AWS ACCOUNT cluster mwaa eks user arn aws eks eu central nd AWS ACCOUNT cluster mwaa eks name awscurrent context awskind Configpreferences users name arn aws eks eu central nd AWS ACCOUNT cluster mwaa eks user exec apiVersion client authentication ks io vbeta args region eu central eks get token cluster name mwaa eks role arn aws iam nd AWS ACCOUNT role mwaa eks access command awsUpdating the DAGI create a new DAG file based on the original changing a few details to point to both the new kube config file as well as the different Kubernetes namespace from airflow import DAGfrom datetime import datetimefrom airflow providers cncf kubernetes operators kubernetes pod import KubernetesPodOperatordefault args owner aws depends on past False start date datetime provide context True dag DAG kubernetes pod example default args default args schedule interval None use a kube config stored in s dags folder for nowkube config path usr local airflow dags kube config yaml podRun KubernetesPodOperator namespace mwaa image ubuntu image public ecr aws aws cli aws cli cmds bash arguments c aws sts get caller identity query Account output text labels foo bar name mwaa pod test task id pod task get logs True dag dag is delete operator pod False config file kube config path in cluster False cluster context aws And that should be it When we upload the new DAG and Kube Config files and then trigger the new DAG We see the following output UTC kubernetes pod py INFO Creating pod mwaa pod test bebababfcfcefbb with labels dag id kubernetes pod example task id pod task execution date T caeb try number UTC pod manager py WARNING Pod not yet started mwaa pod test bebababfcfcefbb UTC pod manager py WARNING Pod not yet started mwaa pod test bebababfcfcefbb UTC pod manager py WARNING Pod not yet started mwaa pod test bebababfcfcefbb UTC pod manager py WARNING Pod not yet started mwaa pod test bebababfcfcefbb UTC pod manager py WARNING Pod not yet started mwaa pod test bebababfcfcefbb UTC pod manager py WARNING Pod not yet started mwaa pod test bebababfcfcefbb UTC pod manager py WARNING Pod not yet started mwaa pod test bebababfcfcefbb UTC pod manager py WARNING Pod not yet started mwaa pod test bebababfcfcefbb UTC pod manager py INFO nd AWS ACCOUNT UTC pod manager py INFO Pod mwaa pod test bebababfcfcefbb has phase Running UTC kubernetes pod py INFO skipping deleting pod mwaa pod test bebababfcfcefbb UTC taskinstance py INFO Marking task as SUCCESS dag id kubernetes pod example task id pod task execution date T start date T end date T UTC local task job py INFO Task exited with return code UTC local task job py INFO downstream tasks scheduled from follow on schedule checkWe can see the output has changed and we now see the nd AWS ACCOUNT number listed Congratulations you have now run your task on an EKS Cluster in a different AWS account Cleaning upOnce you have gone through this be sure to clean up and delete these resources that you have created The quickest way is to go to the CloudFormation and delete the stacks that have been created It will take around minutes for the cleanup to complete ConclusionIn this short walk through we built upon a previous blog post Working with Amazon EKS and Amazon Managed Workflows for Apache Airflow v x and extended this to show how you can run those tasks on other AWS Accounts 2023-01-09 17:36:43
海外TECH DEV Community Axios GET and POST examples https://dev.to/alakkadshaw/axios-get-and-post-examples-npi Axios GET and POST examplesThis article was originally published on the DeadSimpleChat Blog Axios GET and POST examplesIn this article we are going to learn about how to send get and post requests with Axios Axios is a promise based HTTP client for the browser and node js server Axios can run the same code in the browser as well as on the server On the NodeJs server side it uses the  HTTP module and on the browser side it uses XMLHttpRequestsWe are going to learn more about Axios below along with detailed examples of how to send and receive HTTP requests for POST and GETNew to DeadSimpleChat It s a turn key chat that you can easily add to your website or App ーwithout any complicated code For Virtual Live events SaaS App Social Platform Education Gaming Finance Sign Up for Free Installing AxiosThere are multiple ways to installing axios here are someUsing npm npm install axiosusing bower bower install axiosUsing Yarn yarn add axiosUsing CDN JsDelivr and unpkg both provide CDN scirpts for Axios using JsDelivr lt script src gt lt script gt using unpkg CDN lt script src gt lt script gt Now that we have installed the axios Let us go towards a easy example on how to send requestsNew to DeadSimpleChat It s a turn key chat that you can easily add to your website or App ーwithout any complicated code For Virtual Live events SaaS App Social Platform Education Gaming Finance Sign Up for Free Making POST Request with Axios with JSONNow let us create a POST request with Axios and there send the JSON data along with itfirst let us require axios in our project like const axios require axios default axios lt method gt will now provide autocomplete and parameter typingsNow creating a POST requestaxios post addCandy candyName Mars Bar quantity What are we doing wereWe are using the axios post to make a POST request on the path addCandy and along with the POST request we are sending the JSON data candyName Mars Bar quantity When the server that receives this post request will save this data in its database and send a response back that all is ok with a response code of or it will send a response that some error has occurred along with corresponding response code and error messageWe need to record what message and code the server has sent we will be doing that nextaxios post addCandy candyName Mars Bar quantity then function response console log response Also it might happen that we are making a mistake in making the request and an error is happening on our side We need to catch that error as well Let s add another line of code to catch that error as well catch function error console log error the complete code looks likeaxios post addCandy candyName Mars Bar quantity then function response console log response catch function error console log error The POST Request can also be sent by passing the relevant config to the axiosaxios config sending a post requestaxios method post url addCandy data candyName Mars Bar quantity There are also alias methods that can be used as an alternative to the above methodsaxios post url data config Making POST Request with Axios using Async AwaitA cleaner and simpler way of making POST request with Axios is by using the async await keywords POST request with HTTP headersAdding HTTP headers to our post Request is quite easy Just add the headers to the config sending a post requestaxios method post url addCandy data candyName Mars Bar quantity headers X Custom Header foobar then function response console log response Error Handling with POST and Get RequestIt is quite easy to handle error requests with Axios Here is an example of how you can handle error requests with Axios sending a post requestaxios method post url addCandy data candyName Mars Bar quantity catch function error if error response the request was made and the server responded with the response code that is out of xx console log error response data console log error response status console log error response headers else if error request the request was made but no response was recieved the error request is an instance of XMLHttpRequest in the browser and a instance of http ClientRequet in Node Js console log error request else Something happened that triggered an error console log error error message console log err error config What are we doing hereWe are sending a POST request using Axios and catching the error of it occursIf the error has response code out of the xx success code then we are logging the data response code and the http headers that are returned by the server to better understand why the error occurredIf there is some problem with the request that we are sending then we are logging that to the consoleIf there is no problem with the request or the response and there is some other error that is occurring than we are also logging that to the consoleIn the end if there is something wrong with the config then we are logging that to the console ValidateStatus config optionUsing the validateStatus config option we can define the HTTP codes that should throw an error like for exampleaxios get get candies validateStatus function status return status lt Resolve only if the status code is less than Using toJSONIf you need more information about the HTTP error code you can convert the error code to JSON using the toJSON function That would give you more information regarding the error axios get get candies catch function error console log error toJSON Making GET Request with Axios with JSONFirst let us add the Axios to our projectconst axios require axios default and let us make the GET request Make a request for candiesaxios get get candies then function response handle success console log response catch function error handle error console log error then function always executed We are making a GET request to the url get candies to get a list of candies from the server Then we are logging the response that we get from the server on to the console The server might give us the data in the form of a list of candies along with the xx response code or the server might give us an errorIf the server gives us an error we are logging that error on to the consoleNow we might want to add params to our request like for example Make a request forcandies from a brand nameaxios get get candies brand mars then function response handle success console log response catch function error handle error console log error then function always executed Now we have added a params like parameterName valueWe can also make the GET request using the alternative methodaxios get user params ID then function response console log response catch function error console log error then function always executed This method is the similar to the previous method only thing being we have changed the config a bit for readability and it is easier this way to pass multiple parameters while sending the requests Making GET Request with Axios using Async AwaitIt is also very easy to make requests using async await keywords Keep in mind though older browsers like IE do not support the async keyword var candies async function getCandies try const response await axios get user ID console log response catch error console error error This way we can send GET requests using the Async Await keywordsNew to DeadSimpleChat It s a turn key chat that you can easily add to your website or App ーwithout any complicated code For Virtual Live events SaaS App Social Platform Education Gaming Finance Sign Up for Free Intercepting req and resYou can intercept requests or response befoer they are handled by then or catchCreate a intereceptor like Add a request interceptoraxios interceptors request use function config Do something before request is sent return config function error Do something with request error return Promise reject error and if you need to add a response interceptor then Add a response interceptoraxios interceptors response use function response Any status code that lie within the range of xx cause this function to trigger Do something with response data return response function error Any status codes that falls outside the range of xx cause this function to trigger Do something with response error return Promise reject error If you need to remove the interceptor later on in the codeconst myInterceptor axios interceptors request use function axios interceptors request eject myInterceptor Response SchemaThe response schema of a request is as follows You can use the response schema to log information that is relevant to you Response provided by the server is data data HTTP code sent by the server is status status headers the HTTP headers that the server responded with All header names are lower cased and can be accessed using the bracket notation Example response headers content type headers config is the config that was provided to axios for the request config request is the request that generated this response It is the last ClientRequest instance in node js in redirects and an XMLHttpRequest instance in the browser request You can log the information that is relevant to you likeaxios get candies then function response console log response data console log response status console log response statusText console log response headers console log response config How to cancel requestsYou can cancel Axios requests using the AbortControllerconst controller new AbortController axios get candies signal controller signal then function response cancel the requestcontroller abort A note the cancelToken API has been depricated since the version v and no longer works in the newer versions URL encoding instead of JSONBy default the Axios serializes the body object in JSON but if you wish to send the request in application x www form urlencoded then you can do so using the below options In the Browserconst params new URLSearchParams params append param value params append param value axios post send candy params Note the URLSearchParams is not supported by all browsers In Node JSusing the querystring module you can send the requests for exampleconst querystring require querystring axios post querystring stringify candy mars bar ConclusionIn this article I explained with examples how to send POST and GET requests with Axios 2023-01-09 17:15:23
海外TECH DEV Community Actually, dark mode can save the planet https://dev.to/shadowfaxrodeo/actually-dark-mode-can-save-the-planet-3fg6 Actually dark mode can save the planetThis is an update to an article I wrote last year I ll briefly go over it again here There s no need to read the old article actually I d rather you didn t Was Blackle right Many years ago I was introduced to Blackle Blackle is just Google with a black background Why A black background uses less light and so less electricity than a white background ー and if everyone used Blackle we d pollute less carbon into the atmosphere ーand every little helps ーwell that s the idea anyway ーbut is it true Sort of In when Blackle was first launched cathode ray tube CRT monitors were still popular ー around of desktop computer monitors were CRTs ーand CRTs do use less electricity displaying black pixels than white pixels A CRT monitor is one of those old non flat ones They look like this The blog post that inspired blackle used this figure to suggest that megawatt hours a year would be saved if google went black That s equivalent to the electricity use of about households in the USA The remaining CRT screens were rapidly replaced with Liquid crystal displays LCDs use the same power regardless of the screen color ーand so Blackle became redundant…That is until OLED screens became a thing OLED screens like CRTs use less energy when the screen is darker ーand so once again using dark mode saves electricity ーand prevents CO emissions How much CO does dark mode save on an OLED screen We ll do some quick napkin math and get a very rough idea of what kind of energy savings we re dealing with here ー we ll use an iPhone as an example Mobile Enerlytics a company that researches mobile battery drain estimates dark mode saves anywhere between and of battery life depending on what activity is being performed and the screen brightness settings of the phone For instance reading The Verge on dark mode at screen brightness saves battery life compared with light mode An iPhone X uses a watt charger and takes hour to charge If you charge it fully once per day that s watt hours a day kilowatt hours a year I imagine people probably spend most of the time on their phone browsing the web on social media apps or messaging ー that s entirely based on my own experience and not on any data because I can t find any So we ll make a conservative estimate that dark mode saves of battery life In the USA kg of CO is emitted per KWh So million iPhone Xs on dark mode for a year would save about kg of CO The same emissions as cars That was where the previous article concluded Dark mode saves a tiny amount of energy It s not nothing ーbut with million cars in the USA alone it feels like nothing But a big part of this story is missing Built in emmisionsThe largest source of carbon emissions from smart phones and tablets is their production According to Apple each new iPhone will produce kg of carbon is from using the device from transport lt from end of life processing and from its production Producing less stuff has a much larger impact than using stuff less ーand one of the reasons people buy new stuff is because their old stuff is broken One reason people buy a new phone is that the battery has died Companies like Apple make it costly and difficult to replace a battery ーand so people tend to buy a new phone instead Lithium ion batteries can only be used so many times before they stop working ー Apple says iPhone batteries maintain of their capacity after charging cycles  The more energy a phone uses ー the sooner it stops working So supporting dark mode may save more carbon than a few cars Emissions intensityIncreasing the lifetime of a product prevents a new product being created ー which will emit carbon from it s manufacture transport packaging and end of life How you calculate the effect a product s lifetime has on the environment is not immediately obvious at least to me But generally the way it is done is by spreading the built in emissions across the lifetime of the product ーthen dividing those emissions by some measure that s relevant to the use of that product This is called emissions intensity An example of emissions intensityThe emissions intensity of say a car would be calculated with respect to how much mileage the car gives you If it takes tons of CO to build a car and it only travels kilometers before it explodes the emissions intensity of the car would be tons per kilometer For the sake of simplicity we ll use the metric CO per year for the calculation of our smartphone emission intensities and we ll compare it to some other things to give it context Calcualting how much dark mode savesI don t know how much dark mode increases the life time of a phone battery I ve tried my best to find out but there s too much uncertainty So instead of giving you my best guess I ve made a tool that allows you to input your best guess on the missing data I ve prefilled it with information from the iPhone environmental report using million units and my best guesses The code for the calculator is at the bottom of the article Hopefully it ll give you an idea of the scope of this issue There s some factors I ve left out The likelyhood of getting a new phone goes up over time new models are released your phone has aged in other ways software updates have stopped The direct energy savings ー mentioned at the start of the article The second hand market ー phones don t just have one owner before they end up in landfill Batteries get replaced ーand the carbon used to manufacture a battery is less than the device as a whole Maybe dark mode also reduces the chance of screen burn in or increases the life time of other parts And there s likely some I haven t thought of at all Why your website or app should support dark mode It s our responsibility as designers and developers to minimize the damage our products cause Dark mode does have environmental benefits ー and that should be reason enough But it s also what the people want It s easier on the eyes It saves battery Its light is more flattering ーtherefore you re more likely find to love What s more some browsers have the option to use forced dark mode for websites that don t support it This means your website may not render as you intended ー and can lead to readability issues Here s a screen shot from themarkup org in forced dark mode on Google Chrome The links become difficult to read What have I missed If you have any expertise insider knowledge or sources you d like to add let me know and I ll happily update this article 2023-01-09 17:05:16
Apple AppleInsider - Frontpage News How to tether an iPhone to make a wireless hotspot https://appleinsider.com/inside/iphone/tips/how-to-tether-an-iphone-to-make-a-wireless-hotspot?utm_medium=rss How to tether an iPhone to make a wireless hotspotNot every device can be native to a G or G network Here s how to set up your iPhone to act as a wireless hotspot for other devices when a robust Wi Fi connection isn t available Set up a personal hotspot on your iPhone to provide Wi Fi to other devices Before you start connecting devices you ll want to verify the broadcasting capabilities costs and speeds with your carrier Some like T Mobile for example will let you only connect at G speeds unless you opt for a more expensive plan offering Read more 2023-01-09 17:41:17
Apple AppleInsider - Frontpage News Apple Maps gets parking information with SpotHero integration https://appleinsider.com/articles/23/01/09/apple-maps-gets-parking-information-with-spothero-integration?utm_medium=rss Apple Maps gets parking information with SpotHero integrationApple has partnered with SpotHero to integrate parking information in Apple Maps for over locations in the US and Canada Apple Maps has new parking informationUsing an iPhone or Mac users can open Apple Maps and search for a popular location to see if parking information is available Under the More menu a button for parking opens an in app Safari window to SpotHero s website that displays booking information Read more 2023-01-09 17:02:38
Apple AppleInsider - Frontpage News Rolling Square AirCard & AirCard E with Find My -- Hands on https://appleinsider.com/articles/23/01/09/rolling-square-aircard-aircard-e-with-find-my----hands-on?utm_medium=rss Rolling Square AirCard amp AirCard E with Find My Hands onAfter failing to materialize in Rolling Square is committed to launching two Find My enabled cards in ーand we got to check them out early AirCard AirCard ERolling Square offers a wide variety of Apple centric accessories The Chipolo Card Spot or Rolling Square s offering were competing to be the first Find My enabled wallet tracker to hit the market Read more 2023-01-09 17:40:26
海外科学 NYT > Science Asian Researchers Face Disparity With Key U.S. Science Funding Source https://www.nytimes.com/2023/01/04/science/asian-scientists-nsf-funding.html Asian Researchers Face Disparity With Key U S Science Funding SourceWhite researchers fared best in winning grants from the National Science Foundation a study says Asians encounter the highest rate of rejections challenging an academic stereotype 2023-01-09 17:26:59
ニュース @日本経済新聞 電子版 好きが高じれば収益源に ネットが変えた「書く」仕事 https://t.co/zfe014sASH https://twitter.com/nikkei/statuses/1612501614342057990 好き 2023-01-09 17:28:38
ニュース @日本経済新聞 電子版 人類が向かう社会は? 大和ハウス工業のトップと考える https://t.co/NwgBXNfhrJ https://twitter.com/nikkei/statuses/1612496076950614017 大和ハウス工業 2023-01-09 17:06:38
ニュース @日本経済新聞 電子版 大学入学共通テスト、14日から 運営側も問われる対応力 https://t.co/eruc1lAzdI https://twitter.com/nikkei/statuses/1612496075507773440 大学入学共通テスト 2023-01-09 17:06:37
ニュース @日本経済新聞 電子版 コロナ禍の特例貸付、3割が返済不能 2108億円免除決定 https://t.co/DWTUuloQ39 https://twitter.com/nikkei/statuses/1612495349318569984 返済 2023-01-09 17:03:44
ニュース BBC News - Home Two British men missing in Ukraine, say officials https://www.bbc.co.uk/news/uk-64214977?at_medium=RSS&at_campaign=KARANGA ukraine 2023-01-09 17:21:59
ニュース BBC News - Home McDonald's: Former boss Easterbrook fined after staff relationship https://www.bbc.co.uk/news/business-64211747?at_medium=RSS&at_campaign=KARANGA consensual 2023-01-09 17:52:05
ニュース BBC News - Home Formula 1: Andretti bid row reflects turbulent relationship among F1's powerbrokers https://www.bbc.co.uk/sport/formula1/64210632?at_medium=RSS&at_campaign=KARANGA Formula Andretti bid row reflects turbulent relationship among F x s powerbrokersFIA president Mohammed Ben Sulaymen s vocal support for the mooted Andretti team reflects a wider power struggle at the heart of F writes Andrew Benson 2023-01-09 17:27:40
ニュース BBC News - Home Brazil Congress: How police failed to stop the protest https://www.bbc.co.uk/news/64212071?at_medium=RSS&at_campaign=KARANGA buildings 2023-01-09 17:38:46
ニュース BBC News - Home How Trump's allies stoked Brazil Congress attack https://www.bbc.co.uk/news/world-us-canada-64206484?at_medium=RSS&at_campaign=KARANGA january 2023-01-09 17:01:27
ビジネス ダイヤモンド・オンライン - 新着記事 中学受験を考える親が絶対知っておきたい「偏差値との向き合い方」 - ひとりっ子の学力の伸ばし方 https://diamond.jp/articles/-/315187 中学受験 2023-01-10 02:50:00
ビジネス ダイヤモンド・オンライン - 新着記事 【言い換え問題】「発想力」が身につく脳トレ - 1分間瞬読ドリル 超かんたん!入門編 https://diamond.jp/articles/-/315750 【言い換え問題】「発想力」が身につく脳トレ分間瞬読ドリル超かんたん入門編「認知症、ボケ予防に役立つ」「記憶力や思考力がアップし、勉強に活かせる」「頭の回転が速くなった」「本が速く読めて、判断スピードがあがった」「モチベーションの向上、習慣化につながる」「持続力が増して途中で投げ出さなくなった」などの声が届いた、くり返し楽しんで使える『分間瞬読ドリル』に、超入門編が登場。 2023-01-10 02:45:00
ビジネス ダイヤモンド・オンライン - 新着記事 いつも時間に追われてしまう人がやめるべき1つの習慣 - 1秒で答えをつくる力 お笑い芸人が学ぶ「切り返し」のプロになる48の技術 https://diamond.jp/articles/-/315727 2023-01-10 02:40:00
ビジネス ダイヤモンド・オンライン - 新着記事 「イノベーションを起こせる企業」と「淘汰されてしまう企業」の決定的な違いとは? - アジャイル仕事術 https://diamond.jp/articles/-/315689 2023-01-10 02:35:00
ビジネス ダイヤモンド・オンライン - 新着記事 【お金を増やす】 資産2億5000万円を築いたサラリーマン投資家が “ほぼ見限った“6つの投資先とは? - サラリーマン投資家が10倍株で2.5億円 https://diamond.jp/articles/-/315676 【お金を増やす】資産億万円を築いたサラリーマン投資家が“ほぼ見限った“つの投資先とはサラリーマン投資家が倍株で億円株式投資で資産億万円を築いている現役サラリーマン投資家の愛鷹氏。 2023-01-10 02:30:00
Azure Azure の更新情報 At-scale monitoring for Azure Site Recovery with Backup center https://azure.microsoft.com/ja-jp/updates/atscale-monitoring-for-azure-site-recovery-with-backup-center/ At scale monitoring for Azure Site Recovery with Backup centerThe new enhancements released in Backup center enable you to monitor replicated items  jobs and manage them across subscriptions resource groups and locations from a single view 2023-01-09 18:00:08

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)