问:
How do I bind .animate() on parent tag to its child tag?
so I've been trying to build a reactive website, where I've parent tag <form> which changes its size and opacity when hovered. However, inside that form tag I have <input /> tag which should ideally not interrupt with the animation on form tag while mouse hovers on <input />. But, somehow it breaks my animation and I've been struggling with it for a while.

CSS:

```<code>/* Block 1 starts */

#block-1{
    background-image: url("/HealthCare/images/block-1.png");
    background-size: 100%;
    background-repeat: no-repeat;
    height: 400px;
    width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 10px 10px 10px #000000;
    text-shadow: 50px;
    color: #FFFFFF;
    align-items: center;
    border-radius: 5%;
    opacity: 0.8;
    text-align: center;
}

/* Bform-1 starts */

/* Bform-1 Name ends */
article > section > form{
    width: 100%;
    height: 100%;
    overflow: initial;
}
#bform-input-1{
    width: 250px;
    height: 25px;
    overflow: initial;
}

/* Block 1 ends */

/* Block 2 start */
#block-2{
    background-image: url("/HealthCare/images/block-2.png");
    background-size: 100%;
    background-repeat: no-repeat;
    height: 400px;
    width: 400px;
    display: flex;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-style: oblique;
    font-size: 10px 10px 10px #000000;
    text-shadow: 50px;
    color: #FFFFFF;
    justify-content: center;
    align-items: center;
    border-radius: 5%;
    opacity: 0.8;
    text-align: center;
}
/* Block 2 ends */

/* Block 3 start */
#block-3{
    background-image: url("/HealthCare/images/block-3.png");
    background-size: 100%;
    background-repeat: no-repeat;
    height: 400px;
    width: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5%;
    opacity: 0.8;
    text-align: center;
}
/* Block 2 ends */

</code>```

JS and JQuery

```<code> // Block-1 Animation Code.
    $('#block-1').on("mouseover",function(){
        $('#block-1').animate({
            'height':'450px',
            'width':'450px',
            opacity:1
        },100,'linear');
    });
    $('#block-1').on("mouseout",function(){
        $('#block-1').animate({
            'height':'400px',
            'width':'400px',
            opacity:0.8
        },100,'linear');
    });

    // Block-2 Animation Code.
    $('#block-2').on("mouseover",function(){
        $('#block-2').animate({
            'height':'450px',
            'width':'450px',
            opacity:1
        },100,'linear');
    });
    $('#block-2').on("mouseout",function(){
        $('#block-2').animate({
            'height':'400px',
            'width':'400px',
            opacity:0.8
        },100,'linear');
    });

    // Block-3 Animation Code.
    $('#block-3').on("mouseover",function(){
        $('#block-3').animate({
            'height':'450px',
            'width':'450px',
            opacity:1
        },100,'linear');
    });
    $('#block-3').on("mouseout",function(){
        $('#block-3').animate({
            'height':'400px',
            'width':'400px',
            opacity:0.8
        },100,'linear');
    });
});
</code>```

Html

```<code><main>
            <article id="important_inf_blocks">
                <section id="block-1">
                    <form>
                        <input id="bform-input-1" type="text" />
                    </form>
                </section>
                <section id="block-2">
                    block-2
                </section>
                <section id="block-3">
                    block-3
                </section>
            </article>
</main>
</code>```

Body:
so I've been trying to build a reactive website, where I've parent tag <form> which changes its size and opacity when hovered. However, inside that form tag I have <input /> tag which should ideally not interrupt with the animation on form tag while mouse hovers on <input />. But, somehow it breaks my animation and I've been struggling with it for a while.

CSS:

/* Block 1 starts */

#block-1{
    background-image: url("/HealthCare/images/block-1.png");
    background-size: 100%;
    background-repeat: no-repeat;
    height: 400px;
    width: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 10px 10px 10px #000000;
    text-shadow: 50px;
    color: #FFFFFF;
    align-items: center;
    border-radius: 5%;
    opacity: 0.8;
    text-align: center;
}

/* Bform-1 starts */

/* Bform-1 Name ends */
article > section > form{
    width: 100%;
    height: 100%;
    overflow: initial;
}
#bform-input-1{
    width: 250px;
    height: 25px;
    overflow: initial;
}

/* Block 1 ends */

/* Block 2 start */
#block-2{
    background-image: url("/HealthCare/images/block-2.png");
    background-size: 100%;
    background-repeat: no-repeat;
    height: 400px;
    width: 400px;
    display: flex;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-style: oblique;
    font-size: 10px 10px 10px #000000;
    text-shadow: 50px;
    color: #FFFFFF;
    justify-content: center;
    align-items: center;
    border-radius: 5%;
    opacity: 0.8;
    text-align: center;
}
/* Block 2 ends */

/* Block 3 start */
#block-3{
    background-image: url("/HealthCare/images/block-3.png");
    background-size: 100%;
    background-repeat: no-repeat;
    height: 400px;
    width: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5%;
    opacity: 0.8;
    text-align: center;
}
/* Block 2 ends */

JS and JQuery

 // Block-1 Animation Code.
    $('#block-1').on("mouseover",function(){
        $('#block-1').animate({
            'height':'450px',
            'width':'450px',
            opacity:1
        },100,'linear');
    });
    $('#block-1').on("mouseout",function(){
        $('#block-1').animate({
            'height':'400px',
            'width':'400px',
            opacity:0.8
        },100,'linear');
    });

    // Block-2 Animation Code.
    $('#block-2').on("mouseover",function(){
        $('#block-2').animate({
            'height':'450px',
            'width':'450px',
            opacity:1
        },100,'linear');
    });
    $('#block-2').on("mouseout",function(){
        $('#block-2').animate({
            'height':'400px',
            'width':'400px',
            opacity:0.8
        },100,'linear');
    });

    // Block-3 Animation Code.
    $('#block-3').on("mouseover",function(){
        $('#block-3').animate({
            'height':'450px',
            'width':'450px',
            opacity:1
        },100,'linear');
    });
    $('#block-3').on("mouseout",function(){
        $('#block-3').animate({
            'height':'400px',
            'width':'400px',
            opacity:0.8
        },100,'linear');
    });
});

Html

                    <form>
                        <input id="bform-input-1" type="text" />
                    </form>

                    block-2

                    block-3


来源: stackexchange

问:
Display or track dirtied variables in Svelte for examination in dev tools?
I'm struggling with code executing 3,4 or 5 times when I only need it to execute once. To tame this, I need to track down what's causing each reaction. Is there a way to have Svelte list (in the console or something similar) the variables it dirties in the order of reactivity? I'd like to put a breakpoint on the code that's getting executed and hit Play multiple times and find out what variable is reacting that caused the line to execute.

ContentLicense: CC BY-SA 4.0


问:
Debug why gradle caching fails across successful docker build instances?
I am looking at trying to make the gradle 6.9 cache work in a docker CI build invoked by Jenkins running in Kubernetes without access to scan.gradle.org.

The idea is to save an image after gradle --build-cache --no-daemon classes bootJar and use that as the ‘FROM‘ of subsequent builds. This works for me on my own machine, but I cannot make it work on the Jenkins server. Everything happens in the gradle home directory so everything should be cached.  I am wondering if the path to that matters, as it is deep in a Kubernetes mount under ‘/var‘ and this is the only differences between the two docker builds I can think of.

Caching would preferably be for the whole build, but just caching the Maven dependencies would be a substantial saving.

What am i missing? Is there a way to get insight in why Gradle decides to use what it has already or not?


问:
Can I convert a live stream stream using ffmpeg to mpeg2video but using GPU instead of CPU?
As most of you know, Nvenc does not support to encode to mpeg2video, the only way i could find is to encode it using CPU, by using "-c:v mpeg2video" and the nvidia card is not working in this process.. Is there a way to use the GPU nvidia to encode to mpeg2video instead of leaving the work to CPU only? I guess without using the nvenc codec?

I have tried to use -hwaccel_device (nvidia id) and -hwaccel_output_format cuda, with -c:v mpeg2video, but all work is being done by the CPU.

Also tried the -gpu (nvidia id), but it won't make the GPU to take the process either..


问:
Flutter web app closes when pressing android back button in samsung internet instead of route back to previous page
In the application I use Navigator.pushNamed(context, url); to open a new page.
When I use Google Chrome and press the back button on desktop or the android back button the app navigates to the previous page like expected. But when I use the Samsung Internet application on Android the app is shutdown.

I already tried to inmplement the WillPopScope function like this:

```<code>WillPopScope(
onWillPop: () async {
return true;
}),
</code>```

The behaviour of the application is the same as described above.

Body:
In the application I use Navigator.pushNamed(context, url); to open a new page.
When I use Google Chrome and press the back button on desktop or the android back button the app navigates to the previous page like expected. But when I use the Samsung Internet application on Android the app is shutdown.

I already tried to inmplement the WillPopScope function like this:

WillPopScope(
onWillPop: () async {
return true;
}),

The behaviour of the application is the same as described above.


问:
How can I monitor/log file upload progress on a Kestrel web server?
I am trying to monitor the current file's upload progress server side. I can't find a way to intercept the upload event to log the upload progress of a file. I am uploading large files, so this feature is needed to monitor the requests. It seems that my method (below) isn't called until the file has finished uploading entirely.

Here is a snippet of my method that handles the file upload AFTER it is finished:

```<code>[HttpPost("file-upload")]
public async Task<IActionResult> HandleFileUpload(IFormFile file, string? uuid)
{
   ...
}
</code>```

After an hour of googling, I haven't been able to find any information on this topic. Any ideas on this topic would be very helpful.

Body:
I am trying to monitor the current file's upload progress server side. I can't find a way to intercept the upload event to log the upload progress of a file. I am uploading large files, so this feature is needed to monitor the requests. It seems that my method (below) isn't called until the file has finished uploading entirely.

Here is a snippet of my method that handles the file upload AFTER it is finished:

[HttpPost("file-upload")]
public async Task<IActionResult> HandleFileUpload(IFormFile file, string? uuid)
{
   ...
}

After an hour of googling, I haven't been able to find any information on this topic. Any ideas on this topic would be very helpful.


问:
My code to redirect after login is not working
I have a website with Woocommerce and Dokan and im trying to change redirect on login behaviour

I have the following code:

```<code>function filter_woocommerce_login_redirect( $redirect) {
    if ( !is_checkout()) {
        $redirect = home_url();
    } else {
        $redirect = '/checkout';
    }

    return $redirect;
}
add_filter( 'woocommerce_login_redirect', 'filter_woocommerce_login_redirect', 10, 1 );

function filter_woocommerce_registration_redirect( $redirect ) {
    $redirect = home_url();
    return $redirect;
}
add_filter( 'woocommerce_registration_redirect', 'filter_woocommerce_registration_redirect', 10, 1 );
</code>```

However neither works. I am trying to redirect to my home page if they're not on the checkout, otherwise go back to the checkout page after login. I'm also trying to make it so that after they've registered and done the email verification they are redirected to the homepage on sign in, and not the my account dashboard.

When the using the login on the checkout page, the user is always redirected back to the homepage, not back to the checkout

After registration, they are always redirected to the account dashboard and not the homepage?

Any help appreciated, thanks

Body:
I have a website with Woocommerce and Dokan and im trying to change redirect on login behaviour

I have the following code:

function filter_woocommerce_login_redirect( $redirect) {
    if ( !is_checkout()) {
        $redirect = home_url();
    } else {
        $redirect = '/checkout';
    }

    return $redirect;
}
add_filter( 'woocommerce_login_redirect', 'filter_woocommerce_login_redirect', 10, 1 );

function filter_woocommerce_registration_redirect( $redirect ) {
    $redirect = home_url();
    return $redirect;
}
add_filter( 'woocommerce_registration_redirect', 'filter_woocommerce_registration_redirect', 10, 1 );

However neither works. I am trying to redirect to my home page if they're not on the checkout, otherwise go back to the checkout page after login. I'm also trying to make it so that after they've registered and done the email verification they are redirected to the homepage on sign in, and not the my account dashboard.

When the using the login on the checkout page, the user is always redirected back to the homepage, not back to the checkout

After registration, they are always redirected to the account dashboard and not the homepage?

Any help appreciated, thanks


问:
Cannot read properties when used MockWebServer
Hi I am new to the Junit Testing and am trying to test the third party call, for that I have used MockWebServer from okhttp3, the mockWebServer does the job of giving me a proper mocked response but in the class that I am trying to test has the following

```<code>@Autowired
Environment env
....
...
..

String url = env.getProperty(shop.url);
</code>```

The above is significant as it gets the url from application.yml
But the env is null whenever I am running that particular test method which uses MockWebServer

Main Class

```<code>Class ConnectionService {
@Autowired
Environment environment;

public ConnectionService(WebClient.Builder builder) {
this.webClient = builder.defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
        .baseUrl(usersBaseUrl).build();
}

public void getShops(){
...
..
String url = env.getProperty(shop.url);
..
..
}
</code>```

Test Class

```<code>@ExtendWith(SpringExtension.class)
@SpringBootTest
@AutoConfigureWireMock(port = 0)
class ConnectionServiceTest {

public static MockWebServer mockWebServer;
private static ConnectionService connectionService;

@BeforeAll
public static void setUp() throws IOException {
   mockWebServer = new MockWebServer();
   connectionService = new ConnectionService(WebClient.builder(),
mockWebServer.url("/").toString();
}

@AfterAll
static void tearDown() throws IOException {
   mockWebServer.shutdown();
}

@Test
void testMethod() {
   MockResponse mockResponse = new MockResponse()
.addHeader("Content-Type", "application/json; charset=utf-8")
                .setBody("{\"status\":\"up\",\"details\":\"details\"}")
                .throttleBody(16, 5, TimeUnit.SECONDS);
   mockWebServer.enqueue(mockResponse);
   connectionService.getShops();
}
}
</code>```

Could someone please help me out figure what am I doing wrong, is it the MockWebServer that is causing environment to be null ? even the other properties in other files are null. Thanks in advance :)

I tried to test the WebClient by making use of MockWebServer, although it worked but now I cannot read any properties either from application.yml or otherProperties.properties as the environments variables are not getting injected

Body:
Hi I am new to the Junit Testing and am trying to test the third party call, for that I have used MockWebServer from okhttp3, the mockWebServer does the job of giving me a proper mocked response but in the class that I am trying to test has the following

@Autowired
Environment env
....
...
..

String url = env.getProperty(shop.url);

The above is significant as it gets the url from application.yml
But the env is null whenever I am running that particular test method which uses MockWebServer

Main Class

Class ConnectionService {
@Autowired
Environment environment;

public ConnectionService(WebClient.Builder builder) {
this.webClient = builder.defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
        .baseUrl(usersBaseUrl).build();
}

public void getShops(){
...
..
String url = env.getProperty(shop.url);
..
..
}

Test Class

@ExtendWith(SpringExtension.class)
@SpringBootTest
@AutoConfigureWireMock(port = 0)
class ConnectionServiceTest {

public static MockWebServer mockWebServer;
private static ConnectionService connectionService;

@BeforeAll
public static void setUp() throws IOException {
   mockWebServer = new MockWebServer();
   connectionService = new ConnectionService(WebClient.builder(),
mockWebServer.url("/").toString();
}

@AfterAll
static void tearDown() throws IOException {
   mockWebServer.shutdown();
}

@Test
void testMethod() {
   MockResponse mockResponse = new MockResponse()
.addHeader("Content-Type", "application/json; charset=utf-8")
                .setBody("{\"status\":\"up\",\"details\":\"details\"}")
                .throttleBody(16, 5, TimeUnit.SECONDS);
   mockWebServer.enqueue(mockResponse);
   connectionService.getShops();
}
}

Could someone please help me out figure what am I doing wrong, is it the MockWebServer that is causing environment to be null ? even the other properties in other files are null. Thanks in advance :)

I tried to test the WebClient by making use of MockWebServer, although it worked but now I cannot read any properties either from application.yml or otherProperties.properties as the environments variables are not getting injected


问:
Error with yasa in mne. Error unexpected keyword argument 'vmin'

```<code>import yasa
import pandas as pd
data = pd.Series([4, 8, 7, 1, 2, 3, 5],
index=['F4', 'F3', 'C4', 'C3', 'P3', 'P4', 'Oz'],
name='Values'
yasa.topoplot(data,title='My first topoplot')
</code>```

#----- output------

```<code>TypeError: plot_topomap() got an unexpeced keyword argument 'vmin't
</code>```

I change the value vmin and vmax, but it keeps the error

Body:
import yasa
import pandas as pd
data = pd.Series([4, 8, 7, 1, 2, 3, 5],
index=['F4', 'F3', 'C4', 'C3', 'P3', 'P4', 'Oz'],
name='Values'
yasa.topoplot(data,title='My first topoplot')

#----- output------

TypeError: plot_topomap() got an unexpeced keyword argument 'vmin't

I change the value vmin and vmax, but it keeps the error


问:
accessing the response object outside the route handler
i'm trying to build a reusable error handler for express and i thought of build it using an abstract class and a set of sub-classes representing most of the basic Http errors, the abstract class would have a handle method to send the appropriate response for that exception without the need for calling the res.send() function in the handler and here is what i've made so far

HttpError.ts

import { Response } from "express";

export abstract class HttpError extends Error {
  abstract  statusCode: number;
  abstract handle(): Response;
}

```
<p><strong>NotFoundException.ts</strong></p>
<pre class="lang-js prettyprint-override"><code>import { Response, response } from "express";
import { HttpError } from "./HttpError";

export class NotFoundException extends HttpError {
  statusCode: number = 404;
  /**
   *
   */
  constructor() {
    super();
  }

  handle(): Response<any, Record<string, any>> {
    response.g
    return response.status(404).json({
      msg: "resource not found",
    });
  }
}

</code>```

index.ts (with test endpoint)

import { json } from "body-parser";
import cors from "cors";
import express, { NextFunction, Request, Response } from "express";
import { NotFoundException } from "./errors/NotFoundException";
import { HttpError } from "./errors/HttpError";

const app = express();

app.use(json());
app.use(cors());

// endpoint which would throw the error
app.get("/", (req, res) => {
  throw new NotFoundException();
});

// the error handler middleware
app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
   if(err istanceof HttpError) return err.handle();
   next(err)
});

const PORT = 3000;

app.listen(PORT, () => console.info(`App running on port ${PORT}`));

```
<p>The behavior i'm expecting is to get a response object like this</p>
<pre class="lang-json prettyprint-override"><code>{
  "msg": "resource not found"
}
</code>```

but instead i got the following error

```<code>[nodemon] starting `ts-node src/index.ts`
App running on port 3000
TypeError: Cannot read properties of undefined (reading 'get')
    at ServerResponse.json (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/response.js:268:20)
    at NotFoundException.handle (/home/monier/projects/ticketing-app/auth-service/src/errors/NotFoundException.ts:15:33)
    at /home/monier/projects/ticketing-app/auth-service/src/index.ts:16:7
    at Layer.handle_error (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/index.js:326:13)
    at /home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/index.js:286:9
    at Function.process_params (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/index.js:346:12)
    at next (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/index.js:280:10)
    at next (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/route.js:136:14)
    at Layer.handle [as handle_request] (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/layer.js:97:5)
</code>```

after some googling and debugging i found out that the problem was that the response object i'm using in the handle function isn't a live response object.
and i came up with a solution where i pass the res object as an argument to the handle method and it worked.

// the error handler
app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
   if(err istanceof HttpError) return err.handle(res);
   next(err)
});

```

but is there a way to get a live response object but not by passing it as a parameter to the handle function

Body:
i'm trying to build a reusable error handler for express and i thought of build it using an abstract class and a set of sub-classes representing most of the basic Http errors, the abstract class would have a handle method to send the appropriate response for that exception without the need for calling the res.send() function in the handler and here is what i've made so far

HttpError.ts

import { Response } from "express";

export abstract class HttpError extends Error {
  abstract  statusCode: number;
  abstract handle(): Response;
}

NotFoundException.ts

import { Response, response } from "express";
import { HttpError } from "./HttpError";

export class NotFoundException extends HttpError {
  statusCode: number = 404;
  /**
   *
   */
  constructor() {
    super();
  }

  handle(): Response<any, Record<string, any>> {
    response.g
    return response.status(404).json({
      msg: "resource not found",
    });
  }
}

index.ts (with test endpoint)

import { json } from "body-parser";
import cors from "cors";
import express, { NextFunction, Request, Response } from "express";
import { NotFoundException } from "./errors/NotFoundException";
import { HttpError } from "./errors/HttpError";

const app = express();

app.use(json());
app.use(cors());

// endpoint which would throw the error
app.get("/", (req, res) => {
  throw new NotFoundException();
});

// the error handler middleware
app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
   if(err istanceof HttpError) return err.handle();
   next(err)
});

const PORT = 3000;

app.listen(PORT, () => console.info(`App running on port ${PORT}`));

The behavior i'm expecting is to get a response object like this

{
  "msg": "resource not found"
}

but instead i got the following error

[nodemon] starting `ts-node src/index.ts`
App running on port 3000
TypeError: Cannot read properties of undefined (reading 'get')
    at ServerResponse.json (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/response.js:268:20)
    at NotFoundException.handle (/home/monier/projects/ticketing-app/auth-service/src/errors/NotFoundException.ts:15:33)
    at /home/monier/projects/ticketing-app/auth-service/src/index.ts:16:7
    at Layer.handle_error (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/index.js:326:13)
    at /home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/index.js:286:9
    at Function.process_params (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/index.js:346:12)
    at next (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/index.js:280:10)
    at next (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/route.js:136:14)
    at Layer.handle [as handle_request] (/home/monier/projects/ticketing-app/auth-service/node_modules/express/lib/router/layer.js:97:5)

after some googling and debugging i found out that the problem was that the response object i'm using in the handle function isn't a live response object.
and i came up with a solution where i pass the res object as an argument to the handle method and it worked.

// the error handler
app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
   if(err istanceof HttpError) return err.handle(res);
   next(err)
});

but is there a way to get a live response object but not by passing it as a parameter to the handle function


问:
DioError [DioErrorType.other]: FormatException: Scheme not starting with alphabetic character (at character 1)

my json file is as bellow. but i got this error


问:
Problems when capturing video using AVCaptureVideoDataOutput and AVCaptureAudioDataOutput
fellow developers!

I am working on an application for photo and video shooting with the ability to apply filters of the Core Image to frames right during shooting. Rendering and displaying frames using MTKView/Metal.
Everything seems to work well, but I ran into an unpleasant problem: Randomly, from time to time, video recording turns out to be "broken" and the native video player does not open it. In order not to clog up the space here, I pulled the problematic pieces of code into a separate project and posted them on GitHub: https://github.com/VKostin8311/LiveEffectCamera.git .

I hope someone can help me. Thank you in advance!


问:
Is the OpenConnect usable for wireless connection?
I know that Cisco AnyConnect is VPN client and the OpenConnect is the similar one. But Cisco AnyConnect is the whole package including Network Access Manager, which is able to manage connection over wifi network. I would like to know if I could use OpenConnect the same way.

The motivation is that I am not able to install current AnyConnect, but OpenConnect works fine - but only as a VPN client.


问:
Error: The configmap "aws-auth" does not exist
I have seen other examples of this error on here, but they haven't resolved my issue, hopefully someone can explain where i have gone wrong.

I am using the aws eks module: https://github.com/terraform-aws-modules

I have used the default example from Terraform and appreciate i need to clean up some of the code as not all is wanted, but its still valid code.

This is my module code:

```<code>module "eks" {
  source                         = "terraform-aws-modules/eks/aws"
  cluster_name                   = local.name
  cluster_version                = "1.24"
  cluster_endpoint_public_access = true
  cluster_addons = {
    coredns = {
      preserve    = true
      most_recent = true
      timeouts = {
        create = "25m"
        delete = "10m"
      }
    }
    kube-proxy = {
      most_recent = true
    }
    vpc-cni = {
      most_recent = true
    }
  }

  # External encryption key
  create_kms_key = false
  cluster_encryption_config = {
    resources        = ["secrets"]
    provider_key_arn = module.kms.key_arn
  }
  iam_role_additional_policies = {
    additional = aws_iam_policy.additional.arn
  }
  vpc_id                   = data.aws_ssm_parameter.vpc_id.value
  subnet_ids               = split(", ", data.aws_ssm_parameter.private_subnets.value)
  control_plane_subnet_ids = split(", ", data.aws_ssm_parameter.intra_subnets.value)
  # Extend cluster security group rules
  cluster_security_group_additional_rules = {
    ingress_nodes_ephemeral_ports_tcp = {
      description                = "Nodes on ephemeral ports"
      protocol                   = "tcp"
      from_port                  = 1025
      to_port                    = 65535
      type                       = "ingress"
      source_node_security_group = true
    }
    # Test: https://github.com/terraform-aws-modules/terraform-aws-eks/pull/2319
    ingress_source_security_group_id = {
      description              = "Ingress from another computed security group"
      protocol                 = "tcp"
      from_port                = 22
      to_port                  = 22
      type                     = "ingress"
      source_security_group_id = aws_security_group.additional.id
    }
  }
  # Extend node-to-node security group rules
  node_security_group_additional_rules = {
    ingress_self_all = {
      description = "Node to node all ports/protocols"
      protocol    = "-1"
      from_port   = 0
      to_port     = 0
      type        = "ingress"
      self        = true
    }
    # Test: https://github.com/terraform-aws-modules/terraform-aws-eks/pull/2319
    ingress_source_security_group_id = {
      description              = "Ingress from another computed security group"
      protocol                 = "tcp"
      from_port                = 22
      to_port                  = 22
      type                     = "ingress"
      source_security_group_id = aws_security_group.additional.id
    }
  }
  # EKS Managed Node Group(s)
  eks_managed_node_group_defaults = {
    ami_type                              = "AL2_x86_64"
    instance_types                        = [var.micro_ec2_instance, var.small_ec2_instance, var.medium_ec2_instance, var.large_ec2_instance]
    attach_cluster_primary_security_group = true
    vpc_security_group_ids                = [aws_security_group.additional.id]
    iam_role_additional_policies = {
      additional = aws_iam_policy.additional.arn
    }
  }
  eks_managed_node_groups = {
    blue = {}
    green = {
      min_size       = 1
      max_size       = 10
      desired_size   = 1
      instance_types = ["t3.large"]
      capacity_type  = "SPOT"
      labels = {
        Environment = "test"
        GithubRepo  = "terraform-aws-eks"
        GithubOrg   = "terraform-aws-modules"
      }
      taints = {
        dedicated = {
          key    = "dedicated"
          value  = "gpuGroup"
          effect = "NO_SCHEDULE"
        }
      }
      update_config = {
        max_unavailable_percentage = 33 # or set `max_unavailable`
      }
      tags = {
        ExtraTag = "example"
      }
    }
  }

  # aws-auth configmap
  manage_aws_auth_configmap = true

  aws_auth_node_iam_role_arns_non_windows = [
    module.eks_managed_node_group.iam_role_arn,
    #  module.self_managed_node_group.iam_role_arn,
  ]

  aws_auth_roles = var.map_roles

  tags = local.tags
}

module "eks_managed_node_group" {
  source                            = "terraform-aws-modules/eks/aws//modules/eks-managed-node-group"
  name                              = "separate-eks-mng"
  cluster_name                      = module.eks.cluster_name
  cluster_version                   = module.eks.cluster_version
  subnet_ids                        = split(", ", data.aws_ssm_parameter.private_subnets.value)
  cluster_primary_security_group_id = module.eks.cluster_primary_security_group_id
  vpc_security_group_ids = [
    module.eks.cluster_security_group_id,
  ]
  ami_type = "BOTTLEROCKET_x86_64"
  platform = "bottlerocket"
  # this will get added to what AWS provides
  bootstrap_extra_args = <<-EOT
    # extra args added
    [settings.kernel]
    lockdown = "integrity"
    [settings.kubernetes.node-labels]
    "label1" = "foo"
    "label2" = "bar"
  EOT
  tags                 = merge(local.tags, { Separate = "eks-managed-node-group" })
}

module "disabled_eks" {
  source = "terraform-aws-modules/eks/aws"
  create = false
}

module "disabled_fargate_profile" {
  source = "terraform-aws-modules/eks/aws//modules/fargate-profile"
  create = false
}

module "disabled_eks_managed_node_group" {
  source = "terraform-aws-modules/eks/aws//modules/eks-managed-node-group"
  create = false
}

module "disabled_self_managed_node_group" {
  source = "terraform-aws-modules/eks/aws//modules/eks-managed-node-group"
  create = false
}

module "kms" {
  source                = "terraform-aws-modules/kms/aws"
  version               = "1.1.0"
  aliases               = ["eks/${var.project}-${var.application}-${local.name}"]
  description           = "${local.name} cluster encryption key"
  enable_default_policy = true
  key_owners            = [data.aws_caller_identity.current.arn]
  tags                  = local.tags
}

</code>```

I understand the issue lies here:

```<code>  aws_auth_roles = var.map_roles
</code>```

I am passing this variable from my variable.tf file with this:

```<code>variable "map_roles" {
  description = "List of role maps to add to the aws_auth configmap"
  type = list(object({
    rolearn  = string
    username = string
    groups   = list(string)
  }))

  default = []
}
</code>```

The values for this variable are here:

```<code>map_roles = [
  {
    rolearn  = "arn:aws:iam::*account_id*:role/QADevelopersRole"
    username = "QADevelopersRole"
    groups   = ["system:masters"]
  },
  {
    rolearn  = "arn:aws:iam::*account_id*:role/QAAdminRole"
    username = "QAAdminRole"
    groups   = ["system:masters"]
  },
  {
    rolearn  = "arn:aws:iam::*account_id*:role/QASreRole"
    username = "QASreRole"
    groups   = ["system:masters"]
  },
  {
    rolearn  = "arn:aws:iam::*account_id*:role/sandbox-eu-west-2-ContinuousDeliverySlavesRole"
    username = "sandbox-eu-west-2-ContinuousDeliverySlavesRole"
    groups   = ["system:masters"]
  }
]
</code>```

NOTE: I deliberately haven't shared my account id

I can run a terraform init fine. However, when i run a terraform plan i get the following error:

```<code>Plan: 1 to add, 1 to change, 0 to destroy.
module.kms.aws_kms_key.this[0]: Modifying... [id=51a16f6d-fd34-4f79-b750-1e5aee6cb1a8]
module.eks.kubernetes_config_map_v1_data.aws_auth[0]: Creating...
module.kms.aws_kms_key.this[0]: Modifications complete after 5s [id=51a16f6d-fd34-4f79-b750-1e5aee6cb1a8]

Error: The configmap "aws-auth" does not exist

  with module.eks.kubernetes_config_map_v1_data.aws_auth[0],
  on .terraform/modules/eks/main.tf line 527, in resource "kubernetes_config_map_v1_data" "aws_auth":
 527: resource "kubernetes_config_map_v1_data" "aws_auth" {

make: *** [deploy] Error 1
</code>```

My understanding is that the module should create all the kubernetes configuration required automatically, including the configmap.

When running the apply, the following out is generated:

```<code>Validating terraform code.
Success! The configuration is valid.

Deploying the infrastructure on ** 20_eks_cluster **
module.eks.module.kms.data.aws_partition.current: Reading...
data.aws_ssm_parameter.public_subnet_2: Reading...
data.aws_ssm_parameter.public_subnet_3: Reading...
aws_iam_policy.additional: Refreshing state... [id=arn:aws:iam::*accountid*:policy/qa-k8s-poc-Cluster-additional]
module.disabled_eks.module.kms.data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.public_subnets: Reading...
module.eks.data.aws_caller_identity.current: Reading...
module.eks.data.aws_partition.current: Reading...
data.aws_ssm_parameter.intra_subnet_2: Reading...
module.eks.module.kms.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_ssm_parameter.vpc_id: Reading...
module.eks.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_ssm_parameter.private_subnets: Reading...
module.kms.data.aws_partition.current: Reading...
module.kms.data.aws_partition.current: Read complete after 0s [id=aws]
module.eks.module.kms.data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.public_subnets: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/public-subnets]
data.aws_ssm_parameter.public_subnet_3: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/public-subnet-3]
module.disabled_eks_managed_node_group.data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.private_subnet_1: Reading...
data.aws_ssm_parameter.intra_subnet_2: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/intra-subnet-2]
module.disabled_self_managed_node_group.data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.private_subnets: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/public-subnets]
data.aws_ssm_parameter.vpc_id: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/vpc-id]
data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.public_subnet_2: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/public-subnet-2]
module.disabled_self_managed_node_group.data.aws_partition.current: Reading...
module.eks.module.eks_managed_node_group["blue"].data.aws_caller_identity.current: Reading...
module.disabled_self_managed_node_group.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_ssm_parameter.public_subnet_1: Reading...
data.aws_ssm_parameter.private_subnet_1: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/private-subnet-1]
data.aws_availability_zones.available: Reading...
data.aws_ssm_parameter.public_subnet_1: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/public-subnet-1]
module.disabled_fargate_profile.data.aws_partition.current: Reading...
module.disabled_fargate_profile.data.aws_partition.current: Read complete after 0s [id=aws]
module.eks.module.eks_managed_node_group["green"].data.aws_caller_identity.current: Reading...
data.aws_availability_zones.available: Read complete after 0s [id=eu-west-2]
module.disabled_fargate_profile.data.aws_caller_identity.current: Reading...
module.eks.module.kms.data.aws_caller_identity.current: Read complete after 0s [id=*accountid*]
data.aws_ssm_parameter.intra_subnets: Reading...
module.eks.data.aws_caller_identity.current: Read complete after 0s [id=*accountid*]
module.disabled_eks_managed_node_group.data.aws_partition.current: Reading...
module.disabled_eks_managed_node_group.data.aws_partition.current: Read complete after 0s [id=aws]
module.disabled_eks.data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.intra_subnets: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/intra-subnets]
module.kms.data.aws_caller_identity.current: Reading...
module.disabled_eks.module.kms.data.aws_caller_identity.current: Read complete after 0s [id=*accountid*]
module.eks.module.eks_managed_node_group["green"].data.aws_partition.current: Reading...
module.eks.module.eks_managed_node_group["green"].data.aws_partition.current: Read complete after 0s [id=aws]
module.eks.module.eks_managed_node_group["blue"].data.aws_partition.current: Reading...
module.eks.module.eks_managed_node_group["blue"].data.aws_partition.current: Read complete after 0s [id=aws]
module.disabled_eks.data.aws_partition.current: Reading...
module.disabled_eks.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_ssm_parameter.private_subnet_2: Reading...
module.disabled_eks_managed_node_group.data.aws_caller_identity.current: Read complete after 0s [id=*accountid*]
module.disabled_eks.module.kms.data.aws_partition.current: Reading...
module.disabled_eks.module.kms.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_ssm_parameter.intra_subnet_1: Reading...
data.aws_ssm_parameter.private_subnet_2: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/private-subnet-2]
data.aws_ssm_parameter.private_subnet_3: Reading...
data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.eks.aws_cloudwatch_log_group.this[0]: Refreshing state... [id=/aws/eks/qa-k8s-poc-Cluster/cluster]
module.disabled_self_managed_node_group.data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
aws_security_group.additional: Refreshing state... [id=sg-0ddadd651c07cad73]
data.aws_ssm_parameter.intra_subnet_1: Read complete after 1s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/intra-subnet-1]
module.eks.data.aws_iam_session_context.current: Reading...
data.aws_ssm_parameter.private_subnet_3: Read complete after 1s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/private-subnet-3]
module.eks.data.aws_iam_policy_document.assume_role_policy[0]: Reading...
module.eks.data.aws_iam_policy_document.assume_role_policy[0]: Read complete after 0s [id=2764486067]
module.eks.aws_security_group.node[0]: Refreshing state... [id=sg-04759c13ed6856cc0]
module.disabled_fargate_profile.data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.eks.aws_security_group.cluster[0]: Refreshing state... [id=sg-0933687d3eb7462ef]
module.eks.module.eks_managed_node_group["blue"].data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.eks.aws_iam_role.this[0]: Refreshing state... [id=qa-k8s-poc-Cluster-cluster-20230110184259863000000002]
module.eks.module.eks_managed_node_group["green"].data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.disabled_eks.data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.disabled_eks.data.aws_iam_session_context.current: Reading...
module.kms.data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.eks.module.eks_managed_node_group["blue"].data.aws_iam_policy_document.assume_role_policy[0]: Reading...
module.eks.module.eks_managed_node_group["green"].data.aws_iam_policy_document.assume_role_policy[0]: Reading...
module.kms.data.aws_iam_policy_document.this[0]: Reading...
module.eks.module.eks_managed_node_group["green"].data.aws_iam_policy_document.assume_role_policy[0]: Read complete after 0s [id=2560088296]
module.eks.module.eks_managed_node_group["blue"].data.aws_iam_policy_document.assume_role_policy[0]: Read complete after 0s [id=2560088296]
module.kms.data.aws_iam_policy_document.this[0]: Read complete after 0s [id=1077172153]
module.kms.aws_kms_key.this[0]: Refreshing state... [id=51a16f6d-fd34-4f79-b750-1e5aee6cb1a8]
module.eks.module.eks_managed_node_group["green"].aws_iam_role.this[0]: Refreshing state... [id=green-eks-node-group-2023011018430547080000000c]
module.eks.module.eks_managed_node_group["blue"].aws_iam_role.this[0]: Refreshing state... [id=blue-eks-node-group-2023011018430548410000000d]
module.eks.aws_security_group_rule.cluster["ingress_nodes_ephemeral_ports_tcp"]: Refreshing state... [id=sgrule-200464832]
module.eks.aws_security_group_rule.cluster["ingress_nodes_443"]: Refreshing state... [id=sgrule-902431085]
module.eks.aws_security_group_rule.cluster["ingress_source_security_group_id"]: Refreshing state... [id=sgrule-3215013355]
module.eks.aws_security_group_rule.node["ingress_nodes_ephemeral"]: Refreshing state... [id=sgrule-737063987]
module.eks.aws_security_group_rule.node["ingress_cluster_4443_webhook"]: Refreshing state... [id=sgrule-1308494228]
module.eks.data.aws_iam_session_context.current: Read complete after 0s [id=arn:aws:sts::*accountid*:assumed-role/QASreRole/aws-go-sdk-1673428067877551000]
module.eks.aws_security_group_rule.node["egress_all"]: Refreshing state... [id=sgrule-1662029283]
module.eks.aws_security_group_rule.node["ingress_source_security_group_id"]: Refreshing state... [id=sgrule-1683737215]
module.eks.aws_security_group_rule.node["ingress_cluster_kubelet"]: Refreshing state... [id=sgrule-3554252842]
module.eks.aws_security_group_rule.node["ingress_self_coredns_tcp"]: Refreshing state... [id=sgrule-1081401244]
module.eks.aws_security_group_rule.node["ingress_cluster_443"]: Refreshing state... [id=sgrule-1835219689]
module.eks.aws_security_group_rule.node["ingress_cluster_9443_webhook"]: Refreshing state... [id=sgrule-4081148392]
module.eks.aws_security_group_rule.node["ingress_self_coredns_udp"]: Refreshing state... [id=sgrule-3828055155]
module.eks.aws_security_group_rule.node["ingress_self_all"]: Refreshing state... [id=sgrule-424609732]
module.eks.aws_security_group_rule.node["ingress_cluster_8443_webhook"]: Refreshing state... [id=sgrule-2548060707]
module.disabled_eks.data.aws_iam_session_context.current: Read complete after 0s [id=arn:aws:sts::*accountid*:assumed-role/QASreRole/aws-go-sdk-1673428067877551000]
module.kms.aws_kms_alias.this["eks/qa-k8s-poc-aws-alb-controller-qa-k8s-poc-Cluster"]: Refreshing state... [id=alias/eks/qa-k8s-poc-aws-alb-controller-qa-k8s-poc-Cluster]
module.eks.aws_iam_role_policy_attachment.additional["additional"]: Refreshing state... [id=qa-k8s-poc-Cluster-cluster-20230110184259863000000002-2023011018430070560000000a]
module.eks.aws_iam_role_policy_attachment.this["AmazonEKSVPCResourceController"]: Refreshing state... [id=qa-k8s-poc-Cluster-cluster-20230110184259863000000002-20230110184300694600000009]
module.eks.aws_iam_role_policy_attachment.this["AmazonEKSClusterPolicy"]: Refreshing state... [id=qa-k8s-poc-Cluster-cluster-20230110184259863000000002-2023011018430072490000000b]
module.eks.aws_iam_policy.cluster_encryption[0]: Refreshing state... [id=arn:aws:iam::*accountid*:policy/qa-k8s-poc-Cluster-cluster-ClusterEncryption20230110184313822500000016]
module.eks.module.eks_managed_node_group["green"].aws_iam_role_policy_attachment.additional["additional"]: Refreshing state... [id=green-eks-node-group-2023011018430547080000000c-20230110184306195800000011]
module.eks.module.eks_managed_node_group["blue"].aws_iam_role_policy_attachment.additional["additional"]: Refreshing state... [id=blue-eks-node-group-2023011018430548410000000d-20230110184306298500000012]
module.eks.module.eks_managed_node_group["green"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"]: Refreshing state... [id=green-eks-node-group-2023011018430547080000000c-2023011018430617070000000f]
module.eks.module.eks_managed_node_group["green"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"]: Refreshing state... [id=green-eks-node-group-2023011018430547080000000c-2023011018430616410000000e]
module.eks.module.eks_managed_node_group["blue"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"]: Refreshing state... [id=blue-eks-node-group-2023011018430548410000000d-20230110184306299300000013]
module.eks.module.eks_managed_node_group["blue"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"]: Refreshing state... [id=blue-eks-node-group-2023011018430548410000000d-20230110184306309800000014]
module.eks.module.eks_managed_node_group["blue"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"]: Refreshing state... [id=blue-eks-node-group-2023011018430548410000000d-20230110184306324700000015]
module.eks.module.eks_managed_node_group["green"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"]: Refreshing state... [id=green-eks-node-group-2023011018430547080000000c-20230110184306175400000010]
module.eks.aws_eks_cluster.this[0]: Refreshing state... [id=qa-k8s-poc-Cluster]
module.eks.aws_iam_role_policy_attachment.cluster_encryption[0]: Refreshing state... [id=qa-k8s-poc-Cluster-cluster-20230110184259863000000002-20230110184314107500000017]
module.eks.aws_ec2_tag.cluster_primary_security_group["Environment"]: Refreshing state... [id=sg-091358fdcf58991cf,Environment]
module.eks.aws_ec2_tag.cluster_primary_security_group["Creator"]: Refreshing state... [id=sg-091358fdcf58991cf,Creator]
module.eks.aws_ec2_tag.cluster_primary_security_group["Project"]: Refreshing state... [id=sg-091358fdcf58991cf,Project]
module.eks.data.aws_eks_addon_version.this["coredns"]: Reading...
module.eks.data.aws_eks_addon_version.this["kube-proxy"]: Reading...
module.eks.data.aws_eks_addon_version.this["vpc-cni"]: Reading...
module.eks.aws_ec2_tag.cluster_primary_security_group["Application"]: Refreshing state... [id=sg-091358fdcf58991cf,Application]
module.eks.data.tls_certificate.this[0]: Reading...
module.eks.module.eks_managed_node_group["blue"].aws_launch_template.this[0]: Refreshing state... [id=lt-029f98658fd4d579c]
module.eks.module.eks_managed_node_group["green"].aws_launch_template.this[0]: Refreshing state... [id=lt-042af07b1378b110d]
module.eks.data.tls_certificate.this[0]: Read complete after 0s [id=0fec62e3a5b6c39cf9c786f5984abfdb03f2915d]
module.eks.aws_iam_openid_connect_provider.oidc_provider[0]: Refreshing state... [id=arn:aws:iam::*accountid*:oidc-provider/oidc.eks.eu-west-2.amazonaws.com/id/6AC4517F47D7AABAF1E426B0CB58641C]
module.eks.module.eks_managed_node_group["blue"].aws_eks_node_group.this[0]: Refreshing state... [id=qa-k8s-poc-Cluster:blue-20230110185401924400000020]
module.eks.module.eks_managed_node_group["green"].aws_eks_node_group.this[0]: Refreshing state... [id=qa-k8s-poc-Cluster:green-20230110185401925100000022]
module.eks.data.aws_eks_addon_version.this["vpc-cni"]: Read complete after 0s [id=vpc-cni]
module.eks.data.aws_eks_addon_version.this["kube-proxy"]: Read complete after 0s [id=kube-proxy]
module.eks.data.aws_eks_addon_version.this["coredns"]: Read complete after 0s [id=coredns]
module.eks.aws_eks_addon.this["vpc-cni"]: Refreshing state... [id=qa-k8s-poc-Cluster:vpc-cni]
module.eks.aws_eks_addon.this["kube-proxy"]: Refreshing state... [id=qa-k8s-poc-Cluster:kube-proxy]
module.eks.aws_eks_addon.this["coredns"]: Refreshing state... [id=qa-k8s-poc-Cluster:coredns]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # module.eks.kubernetes_config_map_v1_data.aws_auth[0] will be created
  + resource "kubernetes_config_map_v1_data" "aws_auth" {
      + data          = {
          + "mapAccounts" = jsonencode([])
          + "mapRoles"    = <<-EOT
                - "groups":
                  - "system:bootstrappers"
                  - "system:nodes"
                  "rolearn": "arn:aws:iam::*accountid*:role/blue-eks-node-group-2023011018430548410000000d"
                  "username": "system:node:{{EC2PrivateDNSName}}"
                - "groups":
                  - "system:bootstrappers"
                  - "system:nodes"
                  "rolearn": "arn:aws:iam::*accountid*:role/green-eks-node-group-2023011018430547080000000c"
                  "username": "system:node:{{EC2PrivateDNSName}}"
                - "groups":
                  - "system:masters"
                  "rolearn": "arn:aws:iam::*accountid*:role/QADevelopersRole"
                  "username": "QADevelopersRole"
                - "groups":
                  - "system:masters"
                  "rolearn": "arn:aws:iam::*accountid*:role/QAAdminRole"
                  "username": "QAAdminRole"
                - "groups":
                  - "system:masters"
                  "rolearn": "arn:aws:iam::*accountid*:role/QASreRole"
                  "username": "QASreRole"
                - "groups":
                  - "system:masters"
                  "rolearn": "arn:aws:iam::*accountid*:role/sandbox-eu-west-2-ContinuousDeliverySlavesRole"
                  "username": "sandbox-eu-west-2-ContinuousDeliverySlavesRole"
            EOT
          + "mapUsers"    = jsonencode([])
        }
      + field_manager = "Terraform"
      + force         = true
      + id            = (known after apply)

      + metadata {
          + name      = "aws-auth"
          + namespace = "kube-system"
        }
    }

  # module.kms.aws_kms_key.this[0] will be updated in-place
  ~ resource "aws_kms_key" "this" {
        id                                 = "51a16f6d-fd34-4f79-b750-1e5aee6cb1a8"
      ~ policy                             = jsonencode(
          ~ {
              ~ Statement = [
                    {
                        Action    = "kms:*"
                        Effect    = "Allow"
                        Principal = {
                            AWS = "arn:aws:iam::*accountid*:root"
                        }
                        Resource  = "*"
                        Sid       = "Default"
                    },
                  ~ {
                      ~ Principal = {
                          ~ AWS = "arn:aws:sts::*accountid*:assumed-role/QASreRole/aws-go-sdk-1673381797922395000" -> "arn:aws:sts::*accountid*:assumed-role/QASreRole/aws-go-sdk-1673428067877551000"
                        }
                        # (4 unchanged elements hidden)
                    },
                ]
                # (1 unchanged element hidden)
            }
        )
        tags                               = {
            "Application" = "aws-alb-controller"
            "Creator"     = "Terraform via sandbox-qa-k8s-poc-aws-alb-controller"
            "Environment" = "sandbox"
            "Project"     = "qa-k8s-poc"
        }
        # (10 unchanged attributes hidden)
    }

Plan: 1 to add, 1 to change, 0 to destroy.
module.kms.aws_kms_key.this[0]: Modifying... [id=51a16f6d-fd34-4f79-b750-1e5aee6cb1a8]
module.eks.kubernetes_config_map_v1_data.aws_auth[0]: Creating...
module.kms.aws_kms_key.this[0]: Modifications complete after 4s [id=51a16f6d-fd34-4f79-b750-1e5aee6cb1a8]

Error: The configmap "aws-auth" does not exist

  with module.eks.kubernetes_config_map_v1_data.aws_auth[0],
  on .terraform/modules/eks/main.tf line 527, in resource "kubernetes_config_map_v1_data" "aws_auth":
 527: resource "kubernetes_config_map_v1_data" "aws_auth" {

</code>```

What have a missed here? Many thanks :)

Body:
I have seen other examples of this error on here, but they haven't resolved my issue, hopefully someone can explain where i have gone wrong.

I am using the aws eks module: https://github.com/terraform-aws-modules

I have used the default example from Terraform and appreciate i need to clean up some of the code as not all is wanted, but its still valid code.

This is my module code:

module "eks" {
  source                         = "terraform-aws-modules/eks/aws"
  cluster_name                   = local.name
  cluster_version                = "1.24"
  cluster_endpoint_public_access = true
  cluster_addons = {
    coredns = {
      preserve    = true
      most_recent = true
      timeouts = {
        create = "25m"
        delete = "10m"
      }
    }
    kube-proxy = {
      most_recent = true
    }
    vpc-cni = {
      most_recent = true
    }
  }

  # External encryption key
  create_kms_key = false
  cluster_encryption_config = {
    resources        = ["secrets"]
    provider_key_arn = module.kms.key_arn
  }
  iam_role_additional_policies = {
    additional = aws_iam_policy.additional.arn
  }
  vpc_id                   = data.aws_ssm_parameter.vpc_id.value
  subnet_ids               = split(", ", data.aws_ssm_parameter.private_subnets.value)
  control_plane_subnet_ids = split(", ", data.aws_ssm_parameter.intra_subnets.value)
  # Extend cluster security group rules
  cluster_security_group_additional_rules = {
    ingress_nodes_ephemeral_ports_tcp = {
      description                = "Nodes on ephemeral ports"
      protocol                   = "tcp"
      from_port                  = 1025
      to_port                    = 65535
      type                       = "ingress"
      source_node_security_group = true
    }
    # Test: https://github.com/terraform-aws-modules/terraform-aws-eks/pull/2319
    ingress_source_security_group_id = {
      description              = "Ingress from another computed security group"
      protocol                 = "tcp"
      from_port                = 22
      to_port                  = 22
      type                     = "ingress"
      source_security_group_id = aws_security_group.additional.id
    }
  }
  # Extend node-to-node security group rules
  node_security_group_additional_rules = {
    ingress_self_all = {
      description = "Node to node all ports/protocols"
      protocol    = "-1"
      from_port   = 0
      to_port     = 0
      type        = "ingress"
      self        = true
    }
    # Test: https://github.com/terraform-aws-modules/terraform-aws-eks/pull/2319
    ingress_source_security_group_id = {
      description              = "Ingress from another computed security group"
      protocol                 = "tcp"
      from_port                = 22
      to_port                  = 22
      type                     = "ingress"
      source_security_group_id = aws_security_group.additional.id
    }
  }
  # EKS Managed Node Group(s)
  eks_managed_node_group_defaults = {
    ami_type                              = "AL2_x86_64"
    instance_types                        = [var.micro_ec2_instance, var.small_ec2_instance, var.medium_ec2_instance, var.large_ec2_instance]
    attach_cluster_primary_security_group = true
    vpc_security_group_ids                = [aws_security_group.additional.id]
    iam_role_additional_policies = {
      additional = aws_iam_policy.additional.arn
    }
  }
  eks_managed_node_groups = {
    blue = {}
    green = {
      min_size       = 1
      max_size       = 10
      desired_size   = 1
      instance_types = ["t3.large"]
      capacity_type  = "SPOT"
      labels = {
        Environment = "test"
        GithubRepo  = "terraform-aws-eks"
        GithubOrg   = "terraform-aws-modules"
      }
      taints = {
        dedicated = {
          key    = "dedicated"
          value  = "gpuGroup"
          effect = "NO_SCHEDULE"
        }
      }
      update_config = {
        max_unavailable_percentage = 33 # or set `max_unavailable`
      }
      tags = {
        ExtraTag = "example"
      }
    }
  }

  # aws-auth configmap
  manage_aws_auth_configmap = true

  aws_auth_node_iam_role_arns_non_windows = [
    module.eks_managed_node_group.iam_role_arn,
    #  module.self_managed_node_group.iam_role_arn,
  ]

  aws_auth_roles = var.map_roles

  tags = local.tags
}

module "eks_managed_node_group" {
  source                            = "terraform-aws-modules/eks/aws//modules/eks-managed-node-group"
  name                              = "separate-eks-mng"
  cluster_name                      = module.eks.cluster_name
  cluster_version                   = module.eks.cluster_version
  subnet_ids                        = split(", ", data.aws_ssm_parameter.private_subnets.value)
  cluster_primary_security_group_id = module.eks.cluster_primary_security_group_id
  vpc_security_group_ids = [
    module.eks.cluster_security_group_id,
  ]
  ami_type = "BOTTLEROCKET_x86_64"
  platform = "bottlerocket"
  # this will get added to what AWS provides
  bootstrap_extra_args = <<-EOT
    # extra args added
    [settings.kernel]
    lockdown = "integrity"
    [settings.kubernetes.node-labels]
    "label1" = "foo"
    "label2" = "bar"
  EOT
  tags                 = merge(local.tags, { Separate = "eks-managed-node-group" })
}

module "disabled_eks" {
  source = "terraform-aws-modules/eks/aws"
  create = false
}

module "disabled_fargate_profile" {
  source = "terraform-aws-modules/eks/aws//modules/fargate-profile"
  create = false
}

module "disabled_eks_managed_node_group" {
  source = "terraform-aws-modules/eks/aws//modules/eks-managed-node-group"
  create = false
}

module "disabled_self_managed_node_group" {
  source = "terraform-aws-modules/eks/aws//modules/eks-managed-node-group"
  create = false
}

module "kms" {
  source                = "terraform-aws-modules/kms/aws"
  version               = "1.1.0"
  aliases               = ["eks/${var.project}-${var.application}-${local.name}"]
  description           = "${local.name} cluster encryption key"
  enable_default_policy = true
  key_owners            = [data.aws_caller_identity.current.arn]
  tags                  = local.tags
}

I understand the issue lies here:

  aws_auth_roles = var.map_roles

I am passing this variable from my variable.tf file with this:

variable "map_roles" {
  description = "List of role maps to add to the aws_auth configmap"
  type = list(object({
    rolearn  = string
    username = string
    groups   = list(string)
  }))

  default = []
}

The values for this variable are here:

map_roles = [
  {
    rolearn  = "arn:aws:iam::*account_id*:role/QADevelopersRole"
    username = "QADevelopersRole"
    groups   = ["system:masters"]
  },
  {
    rolearn  = "arn:aws:iam::*account_id*:role/QAAdminRole"
    username = "QAAdminRole"
    groups   = ["system:masters"]
  },
  {
    rolearn  = "arn:aws:iam::*account_id*:role/QASreRole"
    username = "QASreRole"
    groups   = ["system:masters"]
  },
  {
    rolearn  = "arn:aws:iam::*account_id*:role/sandbox-eu-west-2-ContinuousDeliverySlavesRole"
    username = "sandbox-eu-west-2-ContinuousDeliverySlavesRole"
    groups   = ["system:masters"]
  }
]

NOTE: I deliberately haven't shared my account id

I can run a terraform init fine. However, when i run a terraform plan i get the following error:

Plan: 1 to add, 1 to change, 0 to destroy.
module.kms.aws_kms_key.this[0]: Modifying... [id=51a16f6d-fd34-4f79-b750-1e5aee6cb1a8]
module.eks.kubernetes_config_map_v1_data.aws_auth[0]: Creating...
module.kms.aws_kms_key.this[0]: Modifications complete after 5s [id=51a16f6d-fd34-4f79-b750-1e5aee6cb1a8]

Error: The configmap "aws-auth" does not exist

  with module.eks.kubernetes_config_map_v1_data.aws_auth[0],
  on .terraform/modules/eks/main.tf line 527, in resource "kubernetes_config_map_v1_data" "aws_auth":
 527: resource "kubernetes_config_map_v1_data" "aws_auth" {

make: *** [deploy] Error 1

My understanding is that the module should create all the kubernetes configuration required automatically, including the configmap.

When running the apply, the following out is generated:

Validating terraform code.
Success! The configuration is valid.

Deploying the infrastructure on ** 20_eks_cluster **
module.eks.module.kms.data.aws_partition.current: Reading...
data.aws_ssm_parameter.public_subnet_2: Reading...
data.aws_ssm_parameter.public_subnet_3: Reading...
aws_iam_policy.additional: Refreshing state... [id=arn:aws:iam::*accountid*:policy/qa-k8s-poc-Cluster-additional]
module.disabled_eks.module.kms.data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.public_subnets: Reading...
module.eks.data.aws_caller_identity.current: Reading...
module.eks.data.aws_partition.current: Reading...
data.aws_ssm_parameter.intra_subnet_2: Reading...
module.eks.module.kms.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_ssm_parameter.vpc_id: Reading...
module.eks.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_ssm_parameter.private_subnets: Reading...
module.kms.data.aws_partition.current: Reading...
module.kms.data.aws_partition.current: Read complete after 0s [id=aws]
module.eks.module.kms.data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.public_subnets: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/public-subnets]
data.aws_ssm_parameter.public_subnet_3: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/public-subnet-3]
module.disabled_eks_managed_node_group.data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.private_subnet_1: Reading...
data.aws_ssm_parameter.intra_subnet_2: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/intra-subnet-2]
module.disabled_self_managed_node_group.data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.private_subnets: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/public-subnets]
data.aws_ssm_parameter.vpc_id: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/vpc-id]
data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.public_subnet_2: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/public-subnet-2]
module.disabled_self_managed_node_group.data.aws_partition.current: Reading...
module.eks.module.eks_managed_node_group["blue"].data.aws_caller_identity.current: Reading...
module.disabled_self_managed_node_group.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_ssm_parameter.public_subnet_1: Reading...
data.aws_ssm_parameter.private_subnet_1: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/private-subnet-1]
data.aws_availability_zones.available: Reading...
data.aws_ssm_parameter.public_subnet_1: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/public-subnet-1]
module.disabled_fargate_profile.data.aws_partition.current: Reading...
module.disabled_fargate_profile.data.aws_partition.current: Read complete after 0s [id=aws]
module.eks.module.eks_managed_node_group["green"].data.aws_caller_identity.current: Reading...
data.aws_availability_zones.available: Read complete after 0s [id=eu-west-2]
module.disabled_fargate_profile.data.aws_caller_identity.current: Reading...
module.eks.module.kms.data.aws_caller_identity.current: Read complete after 0s [id=*accountid*]
data.aws_ssm_parameter.intra_subnets: Reading...
module.eks.data.aws_caller_identity.current: Read complete after 0s [id=*accountid*]
module.disabled_eks_managed_node_group.data.aws_partition.current: Reading...
module.disabled_eks_managed_node_group.data.aws_partition.current: Read complete after 0s [id=aws]
module.disabled_eks.data.aws_caller_identity.current: Reading...
data.aws_ssm_parameter.intra_subnets: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/intra-subnets]
module.kms.data.aws_caller_identity.current: Reading...
module.disabled_eks.module.kms.data.aws_caller_identity.current: Read complete after 0s [id=*accountid*]
module.eks.module.eks_managed_node_group["green"].data.aws_partition.current: Reading...
module.eks.module.eks_managed_node_group["green"].data.aws_partition.current: Read complete after 0s [id=aws]
module.eks.module.eks_managed_node_group["blue"].data.aws_partition.current: Reading...
module.eks.module.eks_managed_node_group["blue"].data.aws_partition.current: Read complete after 0s [id=aws]
module.disabled_eks.data.aws_partition.current: Reading...
module.disabled_eks.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_ssm_parameter.private_subnet_2: Reading...
module.disabled_eks_managed_node_group.data.aws_caller_identity.current: Read complete after 0s [id=*accountid*]
module.disabled_eks.module.kms.data.aws_partition.current: Reading...
module.disabled_eks.module.kms.data.aws_partition.current: Read complete after 0s [id=aws]
data.aws_ssm_parameter.intra_subnet_1: Reading...
data.aws_ssm_parameter.private_subnet_2: Read complete after 0s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/private-subnet-2]
data.aws_ssm_parameter.private_subnet_3: Reading...
data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.eks.aws_cloudwatch_log_group.this[0]: Refreshing state... [id=/aws/eks/qa-k8s-poc-Cluster/cluster]
module.disabled_self_managed_node_group.data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
aws_security_group.additional: Refreshing state... [id=sg-0ddadd651c07cad73]
data.aws_ssm_parameter.intra_subnet_1: Read complete after 1s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/intra-subnet-1]
module.eks.data.aws_iam_session_context.current: Reading...
data.aws_ssm_parameter.private_subnet_3: Read complete after 1s [id=/config/qa-k8s-poc/sandbox/vpc-infrastructure/private-subnet-3]
module.eks.data.aws_iam_policy_document.assume_role_policy[0]: Reading...
module.eks.data.aws_iam_policy_document.assume_role_policy[0]: Read complete after 0s [id=2764486067]
module.eks.aws_security_group.node[0]: Refreshing state... [id=sg-04759c13ed6856cc0]
module.disabled_fargate_profile.data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.eks.aws_security_group.cluster[0]: Refreshing state... [id=sg-0933687d3eb7462ef]
module.eks.module.eks_managed_node_group["blue"].data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.eks.aws_iam_role.this[0]: Refreshing state... [id=qa-k8s-poc-Cluster-cluster-20230110184259863000000002]
module.eks.module.eks_managed_node_group["green"].data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.disabled_eks.data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.disabled_eks.data.aws_iam_session_context.current: Reading...
module.kms.data.aws_caller_identity.current: Read complete after 1s [id=*accountid*]
module.eks.module.eks_managed_node_group["blue"].data.aws_iam_policy_document.assume_role_policy[0]: Reading...
module.eks.module.eks_managed_node_group["green"].data.aws_iam_policy_document.assume_role_policy[0]: Reading...
module.kms.data.aws_iam_policy_document.this[0]: Reading...
module.eks.module.eks_managed_node_group["green"].data.aws_iam_policy_document.assume_role_policy[0]: Read complete after 0s [id=2560088296]
module.eks.module.eks_managed_node_group["blue"].data.aws_iam_policy_document.assume_role_policy[0]: Read complete after 0s [id=2560088296]
module.kms.data.aws_iam_policy_document.this[0]: Read complete after 0s [id=1077172153]
module.kms.aws_kms_key.this[0]: Refreshing state... [id=51a16f6d-fd34-4f79-b750-1e5aee6cb1a8]
module.eks.module.eks_managed_node_group["green"].aws_iam_role.this[0]: Refreshing state... [id=green-eks-node-group-2023011018430547080000000c]
module.eks.module.eks_managed_node_group["blue"].aws_iam_role.this[0]: Refreshing state... [id=blue-eks-node-group-2023011018430548410000000d]
module.eks.aws_security_group_rule.cluster["ingress_nodes_ephemeral_ports_tcp"]: Refreshing state... [id=sgrule-200464832]
module.eks.aws_security_group_rule.cluster["ingress_nodes_443"]: Refreshing state... [id=sgrule-902431085]
module.eks.aws_security_group_rule.cluster["ingress_source_security_group_id"]: Refreshing state... [id=sgrule-3215013355]
module.eks.aws_security_group_rule.node["ingress_nodes_ephemeral"]: Refreshing state... [id=sgrule-737063987]
module.eks.aws_security_group_rule.node["ingress_cluster_4443_webhook"]: Refreshing state... [id=sgrule-1308494228]
module.eks.data.aws_iam_session_context.current: Read complete after 0s [id=arn:aws:sts::*accountid*:assumed-role/QASreRole/aws-go-sdk-1673428067877551000]
module.eks.aws_security_group_rule.node["egress_all"]: Refreshing state... [id=sgrule-1662029283]
module.eks.aws_security_group_rule.node["ingress_source_security_group_id"]: Refreshing state... [id=sgrule-1683737215]
module.eks.aws_security_group_rule.node["ingress_cluster_kubelet"]: Refreshing state... [id=sgrule-3554252842]
module.eks.aws_security_group_rule.node["ingress_self_coredns_tcp"]: Refreshing state... [id=sgrule-1081401244]
module.eks.aws_security_group_rule.node["ingress_cluster_443"]: Refreshing state... [id=sgrule-1835219689]
module.eks.aws_security_group_rule.node["ingress_cluster_9443_webhook"]: Refreshing state... [id=sgrule-4081148392]
module.eks.aws_security_group_rule.node["ingress_self_coredns_udp"]: Refreshing state... [id=sgrule-3828055155]
module.eks.aws_security_group_rule.node["ingress_self_all"]: Refreshing state... [id=sgrule-424609732]
module.eks.aws_security_group_rule.node["ingress_cluster_8443_webhook"]: Refreshing state... [id=sgrule-2548060707]
module.disabled_eks.data.aws_iam_session_context.current: Read complete after 0s [id=arn:aws:sts::*accountid*:assumed-role/QASreRole/aws-go-sdk-1673428067877551000]
module.kms.aws_kms_alias.this["eks/qa-k8s-poc-aws-alb-controller-qa-k8s-poc-Cluster"]: Refreshing state... [id=alias/eks/qa-k8s-poc-aws-alb-controller-qa-k8s-poc-Cluster]
module.eks.aws_iam_role_policy_attachment.additional["additional"]: Refreshing state... [id=qa-k8s-poc-Cluster-cluster-20230110184259863000000002-2023011018430070560000000a]
module.eks.aws_iam_role_policy_attachment.this["AmazonEKSVPCResourceController"]: Refreshing state... [id=qa-k8s-poc-Cluster-cluster-20230110184259863000000002-20230110184300694600000009]
module.eks.aws_iam_role_policy_attachment.this["AmazonEKSClusterPolicy"]: Refreshing state... [id=qa-k8s-poc-Cluster-cluster-20230110184259863000000002-2023011018430072490000000b]
module.eks.aws_iam_policy.cluster_encryption[0]: Refreshing state... [id=arn:aws:iam::*accountid*:policy/qa-k8s-poc-Cluster-cluster-ClusterEncryption20230110184313822500000016]
module.eks.module.eks_managed_node_group["green"].aws_iam_role_policy_attachment.additional["additional"]: Refreshing state... [id=green-eks-node-group-2023011018430547080000000c-20230110184306195800000011]
module.eks.module.eks_managed_node_group["blue"].aws_iam_role_policy_attachment.additional["additional"]: Refreshing state... [id=blue-eks-node-group-2023011018430548410000000d-20230110184306298500000012]
module.eks.module.eks_managed_node_group["green"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"]: Refreshing state... [id=green-eks-node-group-2023011018430547080000000c-2023011018430617070000000f]
module.eks.module.eks_managed_node_group["green"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"]: Refreshing state... [id=green-eks-node-group-2023011018430547080000000c-2023011018430616410000000e]
module.eks.module.eks_managed_node_group["blue"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"]: Refreshing state... [id=blue-eks-node-group-2023011018430548410000000d-20230110184306299300000013]
module.eks.module.eks_managed_node_group["blue"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"]: Refreshing state... [id=blue-eks-node-group-2023011018430548410000000d-20230110184306309800000014]
module.eks.module.eks_managed_node_group["blue"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"]: Refreshing state... [id=blue-eks-node-group-2023011018430548410000000d-20230110184306324700000015]
module.eks.module.eks_managed_node_group["green"].aws_iam_role_policy_attachment.this["arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"]: Refreshing state... [id=green-eks-node-group-2023011018430547080000000c-20230110184306175400000010]
module.eks.aws_eks_cluster.this[0]: Refreshing state... [id=qa-k8s-poc-Cluster]
module.eks.aws_iam_role_policy_attachment.cluster_encryption[0]: Refreshing state... [id=qa-k8s-poc-Cluster-cluster-20230110184259863000000002-20230110184314107500000017]
module.eks.aws_ec2_tag.cluster_primary_security_group["Environment"]: Refreshing state... [id=sg-091358fdcf58991cf,Environment]
module.eks.aws_ec2_tag.cluster_primary_security_group["Creator"]: Refreshing state... [id=sg-091358fdcf58991cf,Creator]
module.eks.aws_ec2_tag.cluster_primary_security_group["Project"]: Refreshing state... [id=sg-091358fdcf58991cf,Project]
module.eks.data.aws_eks_addon_version.this["coredns"]: Reading...
module.eks.data.aws_eks_addon_version.this["kube-proxy"]: Reading...
module.eks.data.aws_eks_addon_version.this["vpc-cni"]: Reading...
module.eks.aws_ec2_tag.cluster_primary_security_group["Application"]: Refreshing state... [id=sg-091358fdcf58991cf,Application]
module.eks.data.tls_certificate.this[0]: Reading...
module.eks.module.eks_managed_node_group["blue"].aws_launch_template.this[0]: Refreshing state... [id=lt-029f98658fd4d579c]
module.eks.module.eks_managed_node_group["green"].aws_launch_template.this[0]: Refreshing state... [id=lt-042af07b1378b110d]
module.eks.data.tls_certificate.this[0]: Read complete after 0s [id=0fec62e3a5b6c39cf9c786f5984abfdb03f2915d]
module.eks.aws_iam_openid_connect_provider.oidc_provider[0]: Refreshing state... [id=arn:aws:iam::*accountid*:oidc-provider/oidc.eks.eu-west-2.amazonaws.com/id/6AC4517F47D7AABAF1E426B0CB58641C]
module.eks.module.eks_managed_node_group["blue"].aws_eks_node_group.this[0]: Refreshing state... [id=qa-k8s-poc-Cluster:blue-20230110185401924400000020]
module.eks.module.eks_managed_node_group["green"].aws_eks_node_group.this[0]: Refreshing state... [id=qa-k8s-poc-Cluster:green-20230110185401925100000022]
module.eks.data.aws_eks_addon_version.this["vpc-cni"]: Read complete after 0s [id=vpc-cni]
module.eks.data.aws_eks_addon_version.this["kube-proxy"]: Read complete after 0s [id=kube-proxy]
module.eks.data.aws_eks_addon_version.this["coredns"]: Read complete after 0s [id=coredns]
module.eks.aws_eks_addon.this["vpc-cni"]: Refreshing state... [id=qa-k8s-poc-Cluster:vpc-cni]
module.eks.aws_eks_addon.this["kube-proxy"]: Refreshing state... [id=qa-k8s-poc-Cluster:kube-proxy]
module.eks.aws_eks_addon.this["coredns"]: Refreshing state... [id=qa-k8s-poc-Cluster:coredns]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # module.eks.kubernetes_config_map_v1_data.aws_auth[0] will be created
  + resource "kubernetes_config_map_v1_data" "aws_auth" {
      + data          = {
          + "mapAccounts" = jsonencode([])
          + "mapRoles"    = <<-EOT
                - "groups":
                  - "system:bootstrappers"
                  - "system:nodes"
                  "rolearn": "arn:aws:iam::*accountid*:role/blue-eks-node-group-2023011018430548410000000d"
                  "username": "system:node:{{EC2PrivateDNSName}}"
                - "groups":
                  - "system:bootstrappers"
                  - "system:nodes"
                  "rolearn": "arn:aws:iam::*accountid*:role/green-eks-node-group-2023011018430547080000000c"
                  "username": "system:node:{{EC2PrivateDNSName}}"
                - "groups":
                  - "system:masters"
                  "rolearn": "arn:aws:iam::*accountid*:role/QADevelopersRole"
                  "username": "QADevelopersRole"
                - "groups":
                  - "system:masters"
                  "rolearn": "arn:aws:iam::*accountid*:role/QAAdminRole"
                  "username": "QAAdminRole"
                - "groups":
                  - "system:masters"
                  "rolearn": "arn:aws:iam::*accountid*:role/QASreRole"
                  "username": "QASreRole"
                - "groups":
                  - "system:masters"
                  "rolearn": "arn:aws:iam::*accountid*:role/sandbox-eu-west-2-ContinuousDeliverySlavesRole"
                  "username": "sandbox-eu-west-2-ContinuousDeliverySlavesRole"
            EOT
          + "mapUsers"    = jsonencode([])
        }
      + field_manager = "Terraform"
      + force         = true
      + id            = (known after apply)

      + metadata {
          + name      = "aws-auth"
          + namespace = "kube-system"
        }
    }

  # module.kms.aws_kms_key.this[0] will be updated in-place
  ~ resource "aws_kms_key" "this" {
        id                                 = "51a16f6d-fd34-4f79-b750-1e5aee6cb1a8"
      ~ policy                             = jsonencode(
          ~ {
              ~ Statement = [
                    {
                        Action    = "kms:*"
                        Effect    = "Allow"
                        Principal = {
                            AWS = "arn:aws:iam::*accountid*:root"
                        }
                        Resource  = "*"
                        Sid       = "Default"
                    },
                  ~ {
                      ~ Principal = {
                          ~ AWS = "arn:aws:sts::*accountid*:assumed-role/QASreRole/aws-go-sdk-1673381797922395000" -> "arn:aws:sts::*accountid*:assumed-role/QASreRole/aws-go-sdk-1673428067877551000"
                        }
                        # (4 unchanged elements hidden)
                    },
                ]
                # (1 unchanged element hidden)
            }
        )
        tags                               = {
            "Application" = "aws-alb-controller"
            "Creator"     = "Terraform via sandbox-qa-k8s-poc-aws-alb-controller"
            "Environment" = "sandbox"
            "Project"     = "qa-k8s-poc"
        }
        # (10 unchanged attributes hidden)
    }

Plan: 1 to add, 1 to change, 0 to destroy.
module.kms.aws_kms_key.this[0]: Modifying... [id=51a16f6d-fd34-4f79-b750-1e5aee6cb1a8]
module.eks.kubernetes_config_map_v1_data.aws_auth[0]: Creating...
module.kms.aws_kms_key.this[0]: Modifications complete after 4s [id=51a16f6d-fd34-4f79-b750-1e5aee6cb1a8]

Error: The configmap "aws-auth" does not exist

  with module.eks.kubernetes_config_map_v1_data.aws_auth[0],
  on .terraform/modules/eks/main.tf line 527, in resource "kubernetes_config_map_v1_data" "aws_auth":
 527: resource "kubernetes_config_map_v1_data" "aws_auth" {

What have a missed here? Many thanks :)


问:
How to set up a collider in threejs
Is there any way to set up a collider on a 3D model like this one spit out by glb to use physics in Three.js?

I couldn't find a way to set up a collider in the Threejs documentation, so I tried using Rapier, but it didn't allow me to set up the collider according to the shape of the 3D model I wanted.

Title: How to set up a collider in threejs


问:
How to skip over a blank cell instead of printing a blank line in Excel subroutine?
I am writing a subroutine in Excel and need to be able to skip over a cell and not print blank lines if statement is false.

The following is from a cell on my spreadsheet

```<code>=IF(B13="Yes",
    " We will show you how to make an Accountant's copy of your Quick Books. You will then upload the file to your secure portal on our web page every quarter, Anyone on your team can walk you through thes process.",
    IF(B16="Yes",
       "On a  quarterly basis we will review your QuickBooks On Line file, download the data to our program. We will also make all journal entries that are required",
       IF(B12="Yes",
          "We will have your vendors start mailing their invoices for you to our office. Checks will be prepared for your approval, signing and mailing. Any payments that can be made online will be done that way with your permission."
       )
    )
)
</code>```

If the answers are No I want to skip to the next cell and not print blank lines when I do a print out. How can I do this?

Body:
I am writing a subroutine in Excel and need to be able to skip over a cell and not print blank lines if statement is false.

The following is from a cell on my spreadsheet

=IF(B13="Yes",
    " We will show you how to make an Accountant's copy of your Quick Books. You will then upload the file to your secure portal on our web page every quarter, Anyone on your team can walk you through thes process.",
    IF(B16="Yes",
       "On a  quarterly basis we will review your QuickBooks On Line file, download the data to our program. We will also make all journal entries that are required",
       IF(B12="Yes",
          "We will have your vendors start mailing their invoices for you to our office. Checks will be prepared for your approval, signing and mailing. Any payments that can be made online will be done that way with your permission."
       )
    )
)

If the answers are No I want to skip to the next cell and not print blank lines when I do a print out. How can I do this?


问:
How to capture new column (current_date) from select statement inside resultMap -- mybatis, java
In the table plugin there is a column id for which I am able to capture records but when it comes to a new column which is not part of table how can I capture the records for it. For example, if I need to return current_date then how this can be achieved as this is not a column name in plugin table.

mapper.xml

```<code><resultMap type="my.class.plugins.Plugin" id="pluginMap">
    <constructor>
        <idArg column="id" javaType = "java.util.UUID"/>
    </constructor>

</resultMap>
</code>```
```<code><select id="getPluginById" resultMap="pluginMap">
 SELECT id, current_date
 FROM public.plugin
</select>
</code>```

java class

```<code>@Value.Immutable
@JsonSerialize
@JsonDeserialize(as = ImmutablePlugin.class)
@Value.Style(allParameters = true)
public abstract class Plugin {

    public Plugin() {

    }

    /**
     * returns id from table plugin
     * @return
     */
    public abstract UUID getId();
}
</code>```

Body:
In the table plugin there is a column id for which I am able to capture records but when it comes to a new column which is not part of table how can I capture the records for it. For example, if I need to return current_date then how this can be achieved as this is not a column name in plugin table.

mapper.xml

<resultMap type="my.class.plugins.Plugin" id="pluginMap">
    <constructor>
        <idArg column="id" javaType = "java.util.UUID"/>
    </constructor>

</resultMap>

<select id="getPluginById" resultMap="pluginMap">
 SELECT id, current_date
 FROM public.plugin
</select>

java class

@Value.Immutable
@JsonSerialize
@JsonDeserialize(as = ImmutablePlugin.class)
@Value.Style(allParameters = true)
public abstract class Plugin {

    public Plugin() {

    }

    /**
     * returns id from table plugin
     * @return
     */
    public abstract UUID getId();
}


问:
Why isn't a named rvalue reference turned to const lvalue reference?
I'm wondering why, in the following example, the function func has this signature:

void func<int&>(int&)

I know that named rvalue references are treated like lvalue references. I'm wondering why they aren't const lvalue references? I was expecting to see void func<const int&>(const int&) as a signature of func function.

```<code>template<typename T>
void func(T&& t) {}

int main()
{
    int&& t = 5;
    func(t);
}
</code>```

Body:
I'm wondering why, in the following example, the function func has this signature:

void func<int&>(int&)

I know that named rvalue references are treated like lvalue references. I'm wondering why they aren't const lvalue references? I was expecting to see void func<const int&>(const int&) as a signature of func function.

template<typename T>
void func(T&& t) {}

int main()
{
    int&& t = 5;
    func(t);
}


问:
Tomcat manager giving 403 access denied when using AWS ELB
I set up a private subnet for a Tomcat server (tomcat 9.0.68) and a public subnet for a Bastion host on AWS.
I set up an application load balancer that forwards traffic to the Tomcat server.
I can access Tomcat main page with the load balancer URL, but when I try to click into "Manage App", I get a 403 access denied error.

On the host server, I configured webapps/manager/META-INF/context.xml to allow remote access to Tomcat Manager. I tested this in the Bastion host and it works. It just doesn't work on the load balancer URL.


问:
How to extract an array from a nested array and loop over it in HTML
I am trying to loop over a nested array similar to the example below, I have tried dot and bracket notation it does not seem work, how do I do this please.</p>
```<code>arr = [{teacher : josh, age : 45},
        subjects:[
        {name : john, age : 20, school : lfc, math : 68, chemistry : 88},
        {name : Dana, age : 22, school : lfc, math : 90, chemistry : 58},
        {name : Daniel, age : 22, school : lfc, math : 90, chemistry : 78}
      ]]
</code>```

Body:
I am trying to loop over a nested array similar to the example below, I have tried dot and bracket notation it does not seem work, how do I do this please.

arr = [{teacher : josh, age : 45},
        subjects:[
        {name : john, age : 20, school : lfc, math : 68, chemistry : 88},
        {name : Dana, age : 22, school : lfc, math : 90, chemistry : 58},
        {name : Daniel, age : 22, school : lfc, math : 90, chemistry : 78}
      ]]


问:
Yarn workspaces failing silently
This is my partial root package.json file:

```<code>"workspaces": [
    "packages/*"
],
"scripts": {
"hello": "yarn workspaces foreach run build",
....}
</code>```

when I run yarn hello, I do not see any output. On running yarn workspaces list, I do see all the packages listed.

However, if I explicitly list the packages in workspaces like:

```<code>"workspaces": [
    "packages/package1",
    "packages/package2"
],
</code>```

I see that build in all the package.json of the packages listed in workspaces are called. How can I fix this?

Title: Yarn workspaces failing silently

Body:
This is my partial root package.json file:

"workspaces": [
    "packages/*"
],
"scripts": {
"hello": "yarn workspaces foreach run build",
....}

when I run yarn hello, I do not see any output. On running yarn workspaces list, I do see all the packages listed.

However, if I explicitly list the packages in workspaces like:

"workspaces": [
    "packages/package1",
    "packages/package2"
],

I see that build in all the package.json of the packages listed in workspaces are called. How can I fix this?


问:
Python: Asyncio + Event Loop is closed on asyncio.run()
This may be a basic question, but I'm trying to understand why I'm getting this error:

```<code>def __run(self, fx):
    return asyncio.run(fx)
</code>```

RuntimeError: Event loop is closed

My understanding was that asyncio.run() always created a new event loop - so why am I getting an error that its closed?

EDIT:
Adding this line gets rid of the error, however I then get another..
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

The new error:

RuntimeError: Task <Task pending name='Task-6'
coro=<_Models_Search.__get_models() running at path >
cb=[_run_until_complete_cb() at path\asyncio\base_events.py:184]> got
Future  attached to a different loop

PS. I'm getting this error running my code in Jupyter, but I did try nest_asyncio as well, and that didn't change the outcome.

Body:
This may be a basic question, but I'm trying to understand why I'm getting this error:

def __run(self, fx):
    return asyncio.run(fx)

RuntimeError: Event loop is closed

My understanding was that asyncio.run() always created a new event loop - so why am I getting an error that its closed?

EDIT:
Adding this line gets rid of the error, however I then get another..
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

The new error:

RuntimeError: Task <Task pending name='Task-6'
coro=<_Models_Search.__get_models() running at path >
cb=[_run_until_complete_cb() at path\asyncio\base_events.py:184]> got
Future  attached to a different loop

PS. I'm getting this error running my code in Jupyter, but I did try nest_asyncio as well, and that didn't change the outcome.


问:
How to Scrape User Data and usernames with InstaGrapi
I am trying to use instagrapi to scrape user data such as "is_private" "is_verified" "username"/
I was able to grab the username but not the rest of the info. can anyone help me please.</p>
```<code>from instagrapi import Client

cl = Client()
cl.login("user", "pass")

def scrapeusers():
    target = input("Please input the target you want to scrape from: ")
    userid = cl.user_id_from_username(target)
    amt = int(input("Please input how many followers you would like to scrape: "))
    scraped = cl.user_followers(user_id=userid, amount=amt)
    User = cl.user_info_by_username(username=str)
    for userid in scraped.items():
        with open("users.txt", "w") as outfile:
            for User in User.items():
                outfile.write(cl.user_info_by_username([0]).dict() + "\n")
scrapeusers()
</code>```

Body:
I am trying to use instagrapi to scrape user data such as "is_private" "is_verified" "username"/
I was able to grab the username but not the rest of the info. can anyone help me please.

from instagrapi import Client

cl = Client()
cl.login("user", "pass")

def scrapeusers():
    target = input("Please input the target you want to scrape from: ")
    userid = cl.user_id_from_username(target)
    amt = int(input("Please input how many followers you would like to scrape: "))
    scraped = cl.user_followers(user_id=userid, amount=amt)
    User = cl.user_info_by_username(username=str)
    for userid in scraped.items():
        with open("users.txt", "w") as outfile:
            for User in User.items():
                outfile.write(cl.user_info_by_username([0]).dict() + "\n")
scrapeusers()


问:
Realm Swift iOS using shouldIncludeInDefaultSchema in Object class crashes app
I write and maintain an xcframework that uses Realm. As well, apps that use our framework would like to use Realm. Therefore, I want to exclude our Object subclasses from the default.realm schema. I have read postings that tout the use of:
public override class func shouldIncludeInDefaultSchema() -> Bool { return false}
in an Object subclass. When I do this I consistently get a crash like this:

2023-01-10 12:18:28.008097-0800 AppIngo *** Terminating app due to uncaught exception 'RLMException', reason: 'Object type 'SomeEntity' not managed by the Realm'

So my questions are:

Is this a supported mechanism for keeping Object subclasses out of the default.realm? If so, is there anything thing we need to do make this work and not crash?

Is there any other strategy/mechanism to achieve what we are looking for.


问:
PHP: CKEDITOR 5 direct export from database
So, I'm using Ckeditor 5 and it works just fine. I can insert, update and even load the saved content back into Ckeditor from the database easily.

The issue is that when it saves in the database, its in the form as an example below:

```<code><p style="text-align: center;"><strong>rich dad poor dad</strong></p>
<p>knjcjdcjhdjehb fdjdnm mn cnxzxjwdmns xz</p>
</code>```

Exporting to the data to PDF when it is loaded into CKeditor is not an issue. But I want to export that data as PDF directly from the database without loading it back into Ckeditor. But as you can see above the content is in these forms. I need help to figure this out. Thank you.

Here is how I'm displaying into CKEDITOR for context.

```<code>   if (isset($_GET['Eid'])) {
        $Eid = $_GET['Eid'];

        include('../connection.php');

        $query = ("SELECT * FROM ebook WHERE Eid='" . $Eid . "'");
        $result = mysqli_query($con, $query);
        $row = mysqli_fetch_assoc($result);

    ?>

            <form method='post' id="form" name="form" action='' enctype="multipart/form-data">

                <b>Content :</b><br>
                    <textarea name="content" id="editor">

                    <?= $row['Content']; ?>

                    </textarea><br>

                <br><br>
                <div class="flex-1">
                    <button class="button btn-3" id="update" name="update" value="update">Save</button>
                </div>
            </form>

        </div>

    <?php
        mysqli_close($con);
    }
    ?>

   // CKEDITOR CDN version
   <script src="https://cdn.ckeditor.com/ckeditor5/35.3.2/super-build/ckeditor.js"></script>
</code>```

Body:
So, I'm using Ckeditor 5 and it works just fine. I can insert, update and even load the saved content back into Ckeditor from the database easily.

The issue is that when it saves in the database, its in the form as an example below:

rich dad poor dad

knjcjdcjhdjehb fdjdnm mn cnxzxjwdmns xz

Exporting to the data to PDF when it is loaded into CKeditor is not an issue. But I want to export that data as PDF directly from the database without loading it back into Ckeditor. But as you can see above the content is in these forms. I need help to figure this out. Thank you.

Here is how I'm displaying into CKEDITOR for context.

   if (isset($_GET['Eid'])) {
        $Eid = $_GET['Eid'];

        include('../connection.php');

        $query = ("SELECT * FROM ebook WHERE Eid='" . $Eid . "'");
        $result = mysqli_query($con, $query);
        $row = mysqli_fetch_assoc($result);

    ?>

            <form method='post' id="form" name="form" action='' enctype="multipart/form-data">

                Content :

                    <textarea name="content" id="editor">

                    <?= $row['Content']; ?>

                    </textarea>

                    <button class="button btn-3" id="update" name="update" value="update">Save</button>

            </form>

    <?php
        mysqli_close($con);
    }
    ?>

   // CKEDITOR CDN version